Back to Blog
Tutorial

Michael Rodriguez6 min
⌘+W

Building automation that spans multiple windows, web apps, and human approvals is hard with simple scripts. You need to manage state, handle retries, and coordinate parallel steps. The Coasty Workflows API lets you describe an entire automation as a versioned JSON DSL. It handles the orchestration and the computer use agent so you only define the steps.

How the Workflows API works

You submit a workflow definition as a JSON object to POST /v1/workflows. Then you start a run with POST /v1/workflows/{id}/runs. The workflow engine follows the DSL, invoking tasks that drive the computer use agent. Each task step is billed $0.05. The engine supports conditions, loops, parallel steps, assertions, and human approval. The run progresses through states like queued, running, succeeded, failed, cancelled, or timed_out.

bash
curl https://coasty.ai/v1/workflows \  -H "Authorization: Bearer $COASTY_API_KEY" \  -H "Content-Type: application/json" \  -d '{
  "version": 1,
  "name": "setup_and_test",
  "variables": {"app_url": "https://example.com"},
  "steps": [
    {
      "id": "start_browser",
      "type": "task",
      "task": "open_browser",
      "params": {"url": "{{app_url}}"}
    },
    {
      "id": "type_email",
      "type": "task",
      "task": "type_text",
      "params": {"selector": "input[name=email]", "text": "[email protected]"}
    },
    {
      "id": "submit",
      "type": "task",
      "task": "click_element",
      "params": {"selector": "button[type=submit]"}
    },
    {
      "id": "check_success",
      "type": "assert",
      "assert": {"field": "success_message", "value": "Login successful"}
    }
  ],
  "hard": {
    "budget_cents": 100,
    "max_iterations": 10,
    "deadline_seconds": 300
  }
}'

Key DSL elements

  • task: a step that invokes a computer use task. Each task step costs $0.05.
  • assert: verifies a field value, failing the run if the assertion fails.
  • if: conditionally executes steps based on a structured condition.
  • loop: repeats steps a configurable number of times or until a condition is met.
  • parallel: executes multiple steps concurrently with a shared timeout.
  • human_approval: pauses the workflow and waits for manual approval.
  • retry: repeats a step on failure, with configurable attempts and backoff.
  • Variables: reference inputs and step fields with double-brace syntax like {{app_url}} and stepId.field.

Every task step is billed $0.05, giving you predictable costs as the workflow grows.

Where this beats brittle automation

Traditional automation relies on brittle selectors, element IDs, or hardcoded API calls. If a UI changes or a DOM structure shifts, the script breaks. The Coasty workflows API drives the computer use agent that sees the screen and acts like a human. The agent adapts to layout changes, handles dynamic content, and works across browsers and desktop apps. You focus on the business logic in the DSL, not on fragile selectors.

Start orchestrating multi-step automations with the Workflows API. Build workflows that handle retries, parallel steps, and human approval. Get your API key and try it out at https://coasty.ai/developers.

© 2026 Coasty

Backed byYCombinator