Quickstart: Your First Agentic Workflow
Run an AI agent in a Jetty sandbox in 5 minutes.
Prerequisites
- A Jetty API token (set as
JETTY_API_TOKEN) curlor any HTTP client
1. Upload a File
Upload a file that your agent will work with:
curl -X POST "https://flows-api.jetty.io/api/v1/files/upload" \
-H "Authorization: Bearer $JETTY_API_TOKEN" \
-F "file=@example.csv" \
-F "collection=my-org"
The response includes a file_path you'll reference in the next step.
2. Run an Agent
Send a runbook request to the chat completions endpoint:
curl -X POST "https://flows-api.jetty.io/v1/chat/completions" \
-H "Authorization: Bearer $JETTY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "system",
"content": "You are a data analyst. Read the uploaded CSV file. Produce a summary report with key statistics, trends, and anomalies. Write your report to /app/results/report.md. Write any charts to /app/results/."
},
{
"role": "user",
"content": "Analyze the dataset"
}
],
"stream": true,
"jetty": {
"runbook": true,
"collection": "my-org",
"task": "analyze-data",
"agent": "claude-code",
"file_paths": ["uploads/example.csv"]
}
}'
Jetty will:
- Provision an isolated sandbox
- Install Claude Code
- Upload your CSV
- Run the agent with your instructions
- Stream progress back via SSE
- Persist all files written to
/app/results/
3. Check the Trajectory
The response includes a trajectory_id. Use it to check status and retrieve artifacts:
curl "https://flows-api.jetty.io/api/v1/trajectories/$TRAJECTORY_ID" \
-H "Authorization: Bearer $JETTY_API_TOKEN"
The trajectory contains:
- Status:
pending,running,completed, orfailed - Artifacts: URLs for all files the agent produced
- Logs: Full execution history
- Usage: Token counts, timing, cost
What Just Happened
Next Steps
- Write a real runbook — See Writing Runbooks for the full structure, evaluation patterns, and authoring guide
- Build a pipeline — See Workflow Orchestration for multi-step DAGs
- Add to CI — See CI Integration for GitHub Actions setup
- Connect telemetry — See Langfuse Setup for automated analysis