Skip to main content
This guide creates one .wire file, sends it to the executor, and reads the JSON result.
1

Start local executor

Run Docker and keep the process alive.
2

Write a minimal workflow

Define one input, one model-backed agent, and one structured output.
3

Execute from Playground or API

Use the Playground for speed, then use curl for integration testing.

1. Start the executor

docker run --rm -p 13703:13703 rmilewski/superwire

2. Create hello.wire

input {
    name: string
}

secrets {
    api_key: string
}

provider llm from openai {
    endpoint: "https://api.openai.com/v1"
    api_key: secrets.api_key
}

model fast from llm {
    id: "gpt-4.1-mini"
}

agent greeting {
    model: model.fast
    instruction: "Greet {{ input.name }} in one friendly sentence."

    output {
        message: string
    }
}

output {
    message: agent.greeting.message
}
Note: endpoint can be any OpenAI-compatible backend URL, as long as that backend supports /responses.

3. Use the Playground (fastest way to test)

You can test .wire files directly in the Playground with a visual interface, without manually base64-encoding workflow source. Open:
http://localhost:13703/playground
In the Playground, you can:
  • Paste or edit your .wire source.
  • Fill input and secrets as JSON.
  • Run the workflow and inspect output and events.
For quick iteration, this is the simplest way to validate and execute workflows.

4. Encode the workflow (CLI/API path)

WORKFLOW_SOURCE_BASE64=$(base64 -w0 hello.wire)

5. Execute it

curl -s http://localhost:13703/execute \
  -H 'Content-Type: application/json' \
  -d @- <<JSON
{
  "input": {
    "name": "Rafael"
  },
  "secrets": {
    "api_key": "sk-..."
  },
  "workflow_source_base64": "$WORKFLOW_SOURCE_BASE64"
}
JSON
Expected response shape:
{
  "message": "Hello Rafael — welcome to Superwire."
}

6. Use streaming when needed

/execute returns Server-Sent Events when you request text/event-stream:
curl -N http://localhost:13703/execute \
  -H 'Accept: text/event-stream' \
  -H 'Content-Type: application/json' \
  -d @- <<JSON
{
  "input": {
    "name": "Rafael"
  },
  "secrets": {
    "api_key": "sk-..."
  },
  "workflow_source_base64": "$WORKFLOW_SOURCE_BASE64"
}
JSON
  • Ensure Docker is running and port 13703 is not already in use.
  • If your response is empty, verify workflow_source_base64 is populated.
  • If provider calls fail, confirm secrets.api_key contains a valid key.