You want to wire together a browser login, a data export, and a file upload into a single, reliable pipeline. You also need to handle retries, conditional logic, and human approvals. The Coasty Workflows API gives you a versioned JSON DSL to define these pipelines declaratively, then let the server drive a computer use agent through each step.
How Workflows Work
A workflow is a versioned JSON DSL. You POST /v1/workflows with a workflow object that contains steps and guards. Each step can be a task, an assert, an if, a loop, parallel, human_approval, retry, succeed, or fail. Variables look like {{inputs.x}} or stepId.field. Guards include budget_cents, max_iterations, and deadline_seconds. Once you submit the workflow, you create runs with POST /v1/workflows/{id}/runs. The server drives the agent on each task step, billing $0.05 per agent step. You can stream events with GET /v1/runs/{id}/events. The run state can be queued, running, awaiting_human, succeeded, failed, cancelled, or timed_out.
curl -X POST https://coasty.ai/v1/workflows \ \
-H 'X-API-Key: $COASTY_API_KEY' \ \
-H 'Content-Type: application/json' \ \
-d '{
"name": "login-export-upload",
"version": "1",
"steps": [
{
"id": "login",
"type": "task",
"task": "Log in to https://example.com/login",
"cua_version": "v3"
},
{
"id": "export",
"type": "task",
"task": "Export data as CSV",
"cua_version": "v3"
},
{
"id": "upload",
"type": "task",
"task": "Upload CSV to https://example.com/upload",
"cua_version": "v3"
},
{
"id": "assert_success",
"type": "assert",
"condition": {
"type": "equal",
"field": "runs.export.status",
"value": "succeeded"
}
},
{
"id": "done",
"type": "succeed"
}
],
"guards": {
"budget_cents": 100,
"max_iterations": 10,
"deadline_seconds": 300
}
}'Create a run and stream events
- POST /v1/workflows/{id}/runs to kick off a workflow run.
- GET /v1/runs/{id}/events streams Server-Sent Events with run state updates.
- Reconnect with the Last-Event-ID header to keep your stream alive.
- A task step bills $0.05 per agent step.
- Guards enforce budget, iteration, and deadline limits.
POST /v1/workflows then POST /v1/workflows/{id}/runs to orchestrate multi-step automations.
Where this beats brittle automation
Traditional automation relies on brittle selectors and fixed API calls. When UI changes, your script breaks. The Coasty Workflows API uses a computer use agent that sees the screen and acts like a human. This means it can handle dynamic navigation, pop-ups, and UI layout shifts. You define intent in the DSL, not low-level clicks or XPath patterns. The server drives real desktops, browsers, and terminals, so your pipeline works on live applications.
Start building orchestrations like login, export, upload, and approval workflows with the Workflows API. Get a key at https://coasty.ai/developers to begin.
Want to see this in action?
View Case Studies