Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion apps/flowlord/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- **Alerting** - Slack notifications for failed tasks and incomplete jobs with smart frequency management
- **RESTful API** - Web UI and API for monitoring workflows, viewing task history, and managing alerts

[![Static Badge](https://img.shields.io/badge/API%20Docs-green)](https://github.com/pcelvng/task-tools/wiki/Flowlord-API)
[![Static Badge](https://img.shields.io/badge/API%20Docs-green)](API.md)

<br clear="all"/>

Expand Down Expand Up @@ -55,6 +55,21 @@ Built-in web UI for monitoring workflows and troubleshooting. Uses Go templates

Access at `http://localhost:8080/` by default (`status_port = 8080`). Set `status_port = 0` to run headless with orchestration only — the dashboard, backload API, and other HTTP endpoints are disabled.

### Row actions (Tasks vs Workflow)

The tasks and workflow tables both expose a leading action column, but the behavior is different:

| View | Row control | What it does |
|------|-------------|----------------|
| **Tasks** (`/web/task`) | Rerun (replay icon) | Opens a confirmation modal, then [`POST /rerun`](API.md#post-rerun) to re-queue **that same task** (same ID and info; retry-related meta is stripped and `rerun=manual` is set). Does **not** open the backload form. |
| **Workflow** (`/web/workflow`) | Run (play icon) | Navigates to `/web/backload` with query parameters prefilled from the phase row (task type, job, workflow file). Optional `preview=1` triggers a dry-run preview on the backload page. |

Use **backload** when you want to generate tasks from phase rules and templates (single time, date range, or batch). Use **rerun** on the tasks page when you want another attempt of an **existing** task record without leaving the task history view.

**Rerun vs automatic retry:** When a task finishes with `error`, Flowlord may retry it automatically according to the phase `retry` count and `retry_delay` rule—each retry reuses the **same task ID** and info and updates retry metadata (`retry`, `delayed`, etc.). A manual rerun does the same ID/info reuse for operators but clears automatic retry fields, tags `rerun=manual`, and sends immediately without waiting for `retry_delay`. See [POST `/rerun`](API.md#post-rerun) in the API doc.

The shared helper `buildBackloadUrl` in `handler/static/utils.js` is wired on the workflow page only (`enableRowBackloadActions` in `workflow.tmpl`). The tasks page registers `enableRowRerunActions` in `task.js` instead.

| Files View | Tasks View | Alerts View | Workflow View |
|:----------:|:----------:|:-----------:|:-------------:|
| [![Files View](../../internal/docs/img/flowlord_files.png)](../../internal/docs/img/flowlord_files.png) | [![Tasks View](../../internal/docs/img/flowlord_tasks.png)](../../internal/docs/img/flowlord_tasks.png) | [![Alerts View](../../internal/docs/img/flowlord_alerts.png)](../../internal/docs/img/flowlord_alerts.png) | [![Workflow View](../../internal/docs/img/flowlord_workflow.png)](../../internal/docs/img/flowlord_workflow.png) |
Expand Down
8 changes: 7 additions & 1 deletion apps/flowlord/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func (tm *taskMaster) StartHandler(serveErr chan<- error) error {
router.Get("/info", tm.Info)
router.Get("/refresh", tm.refreshHandler)
router.Post("/backload", tm.Backloader)
router.Post("/rerun", tm.rerunHandler)
router.Get("/workflow/*", tm.workflowFiles)
router.Get("/workflow", tm.workflowFiles)
router.Get("/notify", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -945,7 +946,12 @@ func (tm *taskMaster) backload(req request) response {
end = at
}

phase := tm.taskCache.Search(req.Task, req.Job)
var phase sqlite.PhaseDB
if req.Workflow != "" {
phase = tm.taskCache.GetPhase(req.Workflow, req.Task, req.Job)
} else {
phase = tm.taskCache.Search(req.Task, req.Job)
}
if phase.FilePath != "" {
msg = append(msg, "phase found in "+phase.FilePath)
req.Template = phase.Template
Expand Down
5 changes: 5 additions & 0 deletions apps/flowlord/handler/backload.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
<div class="info-card template-section" id="templateSection" style="display: none;">
<h3>Template Details</h3>
<div class="template-info">
<div class="form-group">
<label>Workflow</label>
<div class="template-display" id="workflowDisplay"></div>
</div>
<div class="form-group">
<label>Template</label>
<div class="template-display" id="templateDisplay"></div>
Expand Down Expand Up @@ -146,6 +150,7 @@
<thead>
<tr>
<th class="num-column">#</th>
<th class="id-column" id="previewIdHeader" style="display: none;">ID</th>
<th class="type-column">Type</th>
<th class="job-column">Job</th>
<th class="info-column">Info</th>
Expand Down
Loading
Loading