Workflows
A workflow is a saved, multi-step job. Build it once, then run it on demand, on a schedule or from a webhook.
Authored in the dashboard or the API
/dashboard/workflows or with POST /api/v1/workflows. The MCP tool alterlab_workflow_run only runs a saved workflow; agents cannot list or create one. The workflow endpoints, templates included, are part of the workflow-studio beta: an account that is not enrolled gets 403. The shareable trigger URL POST /api/v1/webhooks/{token} is not gated.What a Workflow Is
A workflow has a name, a graph of nodes and edges (scrape, crawl, extract, filter, deliver and more), optional settings, an optional inputs_schema (JSON Schema for typed run inputs) and an optional cron_expression with a timezone. Set is_reusable: true to let your other workflows call it as a sub_workflow node.
Steps and Versions
curl -X POST https://api.alterlab.io/api/v1/workflows/WORKFLOW_ID/versions \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"version": "1.2.0", "notes": "Add price filter"}'This snapshots the current graph as a semver version. GET on the same path lists versions. Pin one for a run with the version field.
Templates and the Marketplace
GET /api/v1/workflows/templates lists templates, GET /api/v1/workflows/templates/{template_id} reads one and POST /api/v1/workflows/templates/{template_id}/use copies it into your account as a new workflow. Browse them in the dashboard under /dashboard/workflows/templates.
Run a Workflow
curl -X POST https://api.alterlab.io/api/v1/workflows/WORKFLOW_ID/run \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"input_data": {"url": "https://example.com"}, "version": "1.2.0"}'The body is optional. input_data is injected into the workflow's webhook_trigger nodes as trigger data. inputs carries typed values validated against inputs_schema. The response holds run_id, workflow_id and status (pending).
Triggers
- Webhook:
POST /api/v1/workflows/{workflow_id}/trigger(authenticated) records the run as webhook-triggered and passes the request body as trigger data. - Shareable URL:
POST /api/v1/workflows/{workflow_id}/tokencreates a trigger token; external systems thenPOST /api/v1/webhooks/{token}with no other credential. The token is the credential, so keep it secret.DELETEon the token path revokes it. - Schedule: set
cron_expressionon the workflow.
Run Status and Results
GET /api/v1/workflows/runs/{run_id} returns status, per-node node_states, total_credits_used, triggered_by, timestamps and error. GET /api/v1/workflows/{workflow_id}/runs lists runs, /runs/{run_id}/stream streams progress as server-sent events, /runs/{run_id}/export exports the result and POST /runs/{run_id}/retry retries a run.
Pricing
A run spends credits for the steps it executes. POST /api/v1/workflows/{workflow_id}/estimate returns estimated_microcents with a per-node-type breakdown before you run. The estimate is debited when the run starts and an insufficient balance returns 402. Nodes billed by a provider at runtime, such as connector actions, are listed in warnings.
Schedules and Agent Runs
Schedules re-run one scrape request on a cron. A workflow chains many steps and can carry a cron itself. Agent runs are one-off plans you submit, estimate and approve under a hard budget; a workflow is saved and reusable.
Reference
Every endpoint is listed in the Workflows API reference.