Orchestrating Multi-Step Automations with the Workflows API
You do not want to stitch together dozens of HTTP calls or write fragile selectors for every screen change. The Workflows API is a versioned JSON DSL that you send to POST /v1/workflows. It lets you define steps like task, assert, if, loop, parallel, human_approval, retry, succeed, and fail. The server runs the chain, manages state, and bills you $0.05 per agent step. This is a full automation stack, not a single API call.
How the Workflows DSL works
You POST a workflow definition to /v1/workflows. The body is a JSON object with a version and a steps array. Each step can be of type task, assert, if, loop, parallel, human_approval, retry, succeed, or fail. Task steps use the task field to describe the work. If steps use conditions and a then and else array. Loop steps repeat a sub‑workflow until a condition is false or max_iterations is hit. Variables are referenced with double‑brace syntax like {{inputs.x}} or stepId.field. You can also set hard guards like budget_cents, max_iterations, and deadline_seconds. The server returns a workflow id you can use to start runs or query status.
curl -X POST https://coasty.ai/v1/workflows \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": "1",
"steps": [
{
"type": "task",
"task": "Open Chrome and navigate to https://example.com",
"id": "open_home"
},
{
"type": "assert",
"condition": {"type": "element_exists", "selector": "h1"},
"then": [
{"type": "succeed"}
],
"else": [
{"type": "fail", "message": "h1 element not found"}
]
},
{
"type": "human_approval",
"id": "approve_click"
},
{
"type": "task",
"task": "Click the submit button and fill out the form",
"id": "submit"
}
],
"hard_guards": {
"max_iterations": 10,
"deadline_seconds": 300
}
}'Starting a workflow run
- ●POST /v1/workflows/{id}/runs with machine_id, task, and optional instructions
- ●Or inline with POST /v1/workflows/runs and pass a versioned DSL directly
- ●cua_version defaults to v3, v4 is autonomous with a pass/fail verifier
- ●Server bills $0.05 per agent step across all task steps in the workflow
- ●Use max_steps and deadline_seconds to bound cost and execution time
Each task step inside the workflow is billed $0.05 per agent step.
Where this beats brittle automation
Selector-based tools break when a UI updates or when a page is rendered dynamically. The computer use API sees the screen and acts like a human, clicking, typing, and scrolling. The Workflows DSL lets you orchestrate many such steps in order, with conditionals, loops, and parallel branches. You can pause for human approval, retry on failure, or abort if the budget runs out. This is a full automation stack built on top of real desktops, browsers, and terminals.
The Workflows API is your DSL for multi-step computer use agents. Define tasks, conditionals, loops, and guards in JSON and let the server drive your desktops, browsers, and terminals. Start building workflows today and pay only for the agent steps you use. Get your key from https://coasty.ai/developers.