Workflow
Use flowbot workflow for platform workflow definitions stored in the database.
YAML is an exchange format for apply / export only — the server does not run from local files.
Prefer the workflows below; load references/schema.md for the full YAML definition,
references/cli.md for flags,
references/steps.md for task action types, inputs/outputs, and usage, and
references/capabilities.md (index) and references/capabilities/<type>.md for every capability:<type>.<op> param list.
Never invent a capability:<type> that is absent from the capabilities index.
Teaching examples (load via read_skill with path):
Setup
- Ensure CLI auth:
flowbot login - Set server via
FLOWBOT_SERVER_URLor--server-url; optional--profile,--debug/-d - Token scopes:
workflow:readfor list/get/export/runs;workflow:runfor apply/delete/run (run also satisfies read) - Prefer
-o jsonwhen parsing results programmatically
Step types
| Prefix | Use |
|---|---|
capability: |
Invoke a Flowbot capability operation (provider or CapCore) |
docker: |
Run a container image via the Docker runtime on the workflow runner |
shell: |
Run a shell command on the workflow runner host |
machine: |
Intended for a named remote machine via SSH runtime |
mapper: |
Inline data transform: render params and marshal to JSON (no external runtime) |
free-form / echo |
Actions without a known prefix fall through to shell-style run; bare echo is a special type name |
Load references/steps.md for per-type inputs/outputs, usage, templates, and conn/retry.
Load references/schema.md before writing any workflow YAML.
Load references/capabilities.md for the capability index; must open references/capabilities/<type>.md before emitting that type's actions.
Templates
Task params use Go text/template delimiters {{ }} (same engine as pipelines).
Variables available in workflows:
| Variable | Access | Source |
|---|---|---|
| Run inputs | {{input "url"}} / {{input.url}} / {{.Input.url}} |
workflow run --input (keys = declared inputs) |
| Prior steps | {{step "id" "result"}} / {{.Steps.id.result}} |
Completed task outputs (result and id hold the same payload) |
Not set for workflows: event / .Event, env / .Env.
Helpers (closed set): input, step, event, jsonpath, jsonpathExists, jsonpathRaw, default, json, len, join, split, contains, now, plus Go builtins if/else/range/eq/printf.
Full list: references/steps.md.
Never invent a helper absent from that list (no Sprig / date / other template libraries).
Workflows
Write or edit a workflow YAML
When the user needs a new or updated workflow definition:
- Load references/schema.md and copy the skeleton (name, enabled, triggers, pipeline, tasks, inputs).
- For each capability: action, open references/capabilities/.md first; never invent types missing from the capabilities index.
- Use only documented template helpers from references/steps.md; never invent helpers.
- Use examples/echo_mapper.yaml, examples/save_and_track.yaml, or examples/parallel_example.yaml as starting points.
- Declare inputs for every {{input.*}} key; use jsonpath for prior capability results (see capabilities.md Common data paths).
flowbot workflow apply --file path/to/workflow.yamlflowbot workflow get <name>- Optional: flowbot workflow run --input '{...}' then flowbot workflow runs .
Apply a definition from YAML
When the user already has a workflow YAML file to create or replace:
- Validate against references/schema.md: name, pipeline, tasks, triggers, and inputs for any {{input.*}} used in params.
flowbot workflow apply --file path/to/workflow.yamlflowbot workflow get <name>
List and inspect
When the user asks what workflows exist or what a workflow contains:
flowbot workflow listflowbot workflow get <name>- Optional: flowbot workflow export -o file.yaml to round-trip YAML.
Run a workflow
When the user wants to execute a stored workflow:
- Build input JSON matching declared inputs (required fields must be present).
flowbot workflow run <name> --input '{"url":"...","title":"..."}'- Note the returned run_id (runs are asynchronous).
flowbot workflow runs <name>
Delete
When the user wants to remove a definition (run history is kept):
flowbot workflow delete <name>
Troubleshooting
| Error | Fix |
|---|---|
| not logged in | flowbot login |
| server URL is required | set FLOWBOT_SERVER_URL or pass --server-url |
| insufficient scope | token needs workflow:read and/or workflow:run |
| workflow name is required / not found | apply first; check list |
| input validation failed | supply all required inputs with correct types |
function "…" not defined |
replace with a helper from references/steps.md; do not invent helpers |
| webhook rejected | workflow must be enabled; trigger needs auth.token or auth.hmac_secret |