Summary
Workflows can pause and resume, but there's no declarative way to involve a human operator mid-workflow. An operator should be able to review outputs, approve/reject, provide input, or view artifacts (images, articles, data) — all through the channel they're already using (Telegram, email, dashboard).
Problem
Current workflows are fully autonomous. When a workflow generates an article, image, or decision that needs human validation, there's no way to:
- Show the output to a human and wait for approval
- Let a human provide corrections or additional input mid-flow
- Route different review steps to different people
- Set timeouts (auto-approve after N hours if no response)
The existing pause_run / resume_run mechanism is low-level (API-only, requires resume tokens). The approval system only covers skill workshop, not workflow steps.
Proposed: operator step mode
New StepMode variant
pub enum StepMode {
Sequential,
FanOut,
Collect,
Conditional { condition: String },
Loop { until: String, max_iterations: usize },
// NEW:
Operator {
/// Who to notify — channel + recipient (e.g., "telegram:@pakman", "email:[email protected]")
notify: Vec<String>,
/// What the operator can do
actions: Vec<OperatorAction>,
/// Auto-resolve after timeout (None = wait forever)
timeout_secs: Option<u64>,
/// What happens on timeout
timeout_action: OperatorTimeoutAction,
},
}
pub enum OperatorAction {
Approve, // approve the previous step's output
Reject, // reject and stop or retry
Edit, // provide corrections/edits
FreeformInput, // open-ended input from the operator
}
pub enum OperatorTimeoutAction {
Approve, // auto-approve on timeout
Reject, // auto-reject on timeout
Pause, // pause workflow (default)
}
Workflow TOML example
name = "publish_article"
[[steps]]
name = "research"
agent = "researcher"
prompt_template = "Research {{topic}} and produce a draft article"
[[steps]]
name = "review_draft"
mode.operator = {
notify = ["telegram:@pakman"],
actions = ["approve", "edit"],
timeout_secs = 86400,
timeout_action = "pause"
}
prompt_template = "Please review this article draft. Approve or suggest edits."
[[steps]]
name = "publish"
agent = "social-media"
prompt_template = "Publish the approved article to the blog"
How it works
- Step N completes → output (article, image, data) is captured
- Operator step begins → workflow pauses, notification sent via specified channel(s)
- Operator receives: previous step's output + action buttons (Approve/Reject/Edit)
- Operator responds: via channel reply (Telegram message, email reply, dashboard button)
- Workflow resumes: operator's response becomes the step output, fed to the next step
- Timeout: if configured, auto-resolves after N seconds
Channel integration
The notification uses the existing channel bridge infrastructure:
- Telegram: sends message with inline keyboard buttons (Approve/Reject) + the artifact
- Email: sends the artifact with reply instructions
- Dashboard: shows in the approvals panel with action buttons
The operator's response is routed back to the workflow via the existing channel_send → agent message path, but targeted at the workflow's pause handler instead of an agent session.
Integration with existing systems
| System |
Role |
pause_run / resume_run |
Underlying mechanism — operator step calls pause, response triggers resume |
Approval system (/api/approvals) |
Extended to support workflow step approvals (not just skills) |
| Channel bridge |
Delivery mechanism for notifications + response capture |
| Dashboard |
UI for pending operator reviews (new section or extension of Approvals page) |
Artifacts
Operator steps should be able to display rich content:
- Text (articles, reports)
- Images (generated images, charts)
- Files (PDFs, CSVs)
- Tables (structured data)
The channel adapter formats these appropriately per platform (Telegram photo + caption, email attachment, dashboard inline preview).
Before
Workflows are fire-and-forget. Human review requires stopping the workflow, manually checking output via API, then restarting.
After
Workflows can declaratively pause for human input at any step, notify the operator via their preferred channel, and resume with their response. Enables: editorial review, approval gates, interactive data collection, quality control.
Related
Summary
Workflows can pause and resume, but there's no declarative way to involve a human operator mid-workflow. An operator should be able to review outputs, approve/reject, provide input, or view artifacts (images, articles, data) — all through the channel they're already using (Telegram, email, dashboard).
Problem
Current workflows are fully autonomous. When a workflow generates an article, image, or decision that needs human validation, there's no way to:
The existing
pause_run/resume_runmechanism is low-level (API-only, requires resume tokens). The approval system only covers skill workshop, not workflow steps.Proposed:
operatorstep modeNew StepMode variant
Workflow TOML example
How it works
Channel integration
The notification uses the existing channel bridge infrastructure:
The operator's response is routed back to the workflow via the existing
channel_send→ agent message path, but targeted at the workflow's pause handler instead of an agent session.Integration with existing systems
pause_run/resume_run/api/approvals)Artifacts
Operator steps should be able to display rich content:
The channel adapter formats these appropriately per platform (Telegram photo + caption, email attachment, dashboard inline preview).
Before
Workflows are fire-and-forget. Human review requires stopping the workflow, manually checking output via API, then restarting.
After
Workflows can declaratively pause for human input at any step, notify the operator via their preferred channel, and resume with their response. Enables: editorial review, approval gates, interactive data collection, quality control.
Related
pause_run/resume_runinworkflow.rs— existing low-level mechanism/api/approvals— existing approval UI (to be extended)crates/librefang-channels/src/bridge.rs)