A workflow adds a schedule, loops, filters and delivery to your methods. A trigger starts each run: manually, on a schedule, or through a webhook. Steps then run in order, and each step can read the output of the steps before it.
Define a workflow as JSON, as on this page, or describe it in a sentence and let Fous draft it from your methods. To connect Slack, Zapier, Make, n8n or an ERP, add a webhook step that posts to their URL, or have them call the workflow's webhook trigger.
This example lists open invoices on a portal, stops if there are none, summarizes the rest, and posts the summary to a webhook.
Create it
Returns 201 with the saved workflow, disabled, including its id, definition, webhook_url and cost. cost.credits is the price of a full run: 3 credits here, one for each of the three action steps (the filter is free). Fous validates the definition against your methods first and returns all validation errors at once, each with its path.
Run it
Any workflow can be run manually, whether it is enabled or not. input provides the trigger's inputs, and wait holds the response for up to 60 seconds (default 0).
200 means the run ended within wait. 202 means it is still running; use its id to read it.
Read the run
Poll the run by id until it ends:
A status of queued, running or waiting means the run is in progress. It ends as completed, failed or canceled. credits is what the run cost, and steps has one entry per step with its input and output:
This example shows only the first entry of steps and omits timestamps. Run a workflow lists every status.
Start it from a webhook
The workflow already has a webhook trigger, so enabling it is all that remains:
The response repeats webhook_url. Any client that can send an HTTP POST can now start a run without an API key, because the URL itself is the secret. The JSON body is the run's input:
Returns 202 with { "run_id": "wfr_…", "workflow_id": "wf_…" }. Read that run the same way. To run on a schedule instead, use a schedule trigger: see Triggers.
Go further
- Create a workflow: from a sentence or from JSON, streaming the draft, and building missing methods.
- Run a workflow: statuses, retries, repairs and pricing.
- Triggers: inputs, schedules and webhooks.
- Steps: every step type, templates and code.