Loading...
Loading...
Interact with the Cargo platform via CLI. Use when the user wants to execute an action, run a workflow, trigger a batch, message an AI agent, query orchestration runtime tables (runs/batches/spans/records) with SQL, fetch segment records, or inspect a model schema.
npx skill4agent add getcargohq/cargo-skills cargo-orchestrationNeed to run something?
├── One action, one record → action execute
├── One action, many records → action execute-batch
├── Multiple actions chained
│ ├── One-off / ad-hoc → run create --nodes (one record)
│ │ batch create --nodes (many records)
│ └── Reusable workflow → build a tool, then run create --workflow-uuid
│ or batch create --workflow-uuid
└── Conversational AI agent → message createTerminology: An orchestration tool is a saved on-demand workflow (listed via). An action is a single operation you execute without building a workflow — it can embed a saved orchestration tool (tool list), call a third-party connector (kind: "tool"), invoke an AI agent (kind: "connector"), or run a built-in platform operation (kind: "agent").kind: "native"
— action execute and execute-batch examplesreferences/actions.md— tool (on-demand workflow) examplesreferences/tools.md— play (segment-driven automation) examplesreferences/plays.md— AI agent chat examplesreferences/agents.md— full node creation guide (kinds, native actions, expressions, validation, routing)references/nodes.md— pre-built workflow templatesreferences/templates.md—references/queries.md(ClickHouse: runs/batches/spans/records) SQL examples. Fororchestration query execute(workspace storage), see thestorage queryskill.cargo-storage— segment fetch and filter examplesreferences/segments.md— full JSON response structuresreferences/response-shapes.md— complete filter condition referencereferences/filter-syntax.md— async polling patterns, error handling, retry strategiesreferences/polling.md— common errors, plus a "Debugging a workflow run" section for runs that succeed but produce wrong output (wrong-branch routing, empty downstream values)references/troubleshooting.md
npm install -g @cargo-ai/cli
cargo-ai login --oauth # browser sign-in (recommended)
# or: cargo-ai login --token <your-api-token> # workspace-scoped API token (non-interactive)
# Pin a default workspace at login (with --oauth)
cargo-ai login --oauth --workspace-uuid <uuid>cargo-ai whoaminpx @cargo-ai/clicargo-ai{"errorMessage": "..."}cargo-ai orchestration play list # all plays (name, workflowUuid, modelUuid, segmentUuid)
cargo-ai orchestration tool list # all tools (name, workflowUuid, description)
cargo-ai orchestration workflow list # all workflows (uuid only — no name)
cargo-ai orchestration template list # all workflow templates (slug, name, kind)
cargo-ai ai agent list # all agents (uuid, name)
cargo-ai ai template list # all AI agent templates (slug, name, languageModelSlug)
cargo-ai storage model list # all models (uuid, name, slug, columns)
cargo-ai storage dataset list # all datasets
cargo-ai segmentation segment list # all segments (uuid, name, modelUuid)
cargo-ai connection connector list # all connectorsnameplay listtool listworkflowUuidapp.getcargo.io/workspaces/<WORKSPACE_UUID>/plays/<PLAY_UUID>app.getcargo.io/workspaces/<WORKSPACE_UUID>/tools/<TOOL_UUID><WORKSPACE_UUID>cargo-ai whoamiworkspace.uuidcargo-ai orchestration template listcargo-ai orchestration template get <slug>kind"kind":"tool""kind":"play"references/templates.mdrun createworkflowUuidplayNotCompatiblebatch createsegmentchangefilterrecordIdsworkflowUuidfilerecords# Single actions
cargo-ai orchestration action execute --action '{"kind":"tool","toolUuid":"<uuid>","config":{}}' --data '{"domain":"acme.com"}'
cargo-ai orchestration action execute-batch --action '{"kind":"connector","integrationSlug":"clearbit","actionSlug":"company_enrich","config":{}}' --records '[{...},{...}]'
# Workflows (chain multiple actions)
cargo-ai orchestration run create --workflow-uuid <uuid> --data '{"company":"Acme","domain":"acme.com"}'
cargo-ai orchestration run create --data '{"domain":"acme.com"}' --nodes '[...]'
cargo-ai orchestration batch create --workflow-uuid <uuid> --data '{"kind":"segment","segmentUuid":"..."}'
# AI agents
cargo-ai ai message create --chat-uuid <uuid> --parts '[{"type":"text","text":"..."}]'
# Data
cargo-ai orchestration query execute "SELECT count() FROM runs WHERE status='error'" # ClickHouse: spans, runs, batches, records
cargo-ai segmentation segment fetch --model-uuid <uuid> --filter '{"conjonction":"and","groups":[]}' --fetching-limit 100
# For SQL against workspace storage (Companies, Contacts, …), see the cargo-storage skill: `storage query execute`--wait-until-finishedaction executeaction execute-batch| Result type | Poll command | Interval | Done when |
|---|---|---|---|
| Run | | 2s | |
| Batch | | 5s | |
| Agent message | | 2s | |
# One action, one record → returns a run
cargo-ai orchestration action execute \
--action '{"kind":"connector","integrationSlug":"clearbit","actionSlug":"company_enrich","config":{}}' \
--data '{"domain":"acme.com"}' \
--wait-until-finished
# One action, many records → returns a batch
cargo-ai orchestration action execute-batch \
--action '{"kind":"tool","toolUuid":"<tool-uuid>","config":{}}' \
--records '[{"domain":"acme.com"},{"domain":"globex.com"}]' \
--wait-until-finishedtoolconnectoragentnativereferences/actions.mdrun createplayNotCompatiblebatch createcargo-ai orchestration run create \
--workflow-uuid <tool.workflowUuid> \
--data '{"company":"Acme","domain":"acme.com"}'
# → Poll with: cargo-ai orchestration run get <run-uuid>
# Or wait synchronously — blocks until the run reaches a terminal state and returns the final result
cargo-ai orchestration run create \
--workflow-uuid <tool.workflowUuid> \
--data '{"company":"Acme","domain":"acme.com"}' \
--wait-until-finished--release-uuidcargo-ai orchestration run cancel --workflow-uuid <uuid> --uuids run-uuid-1,run-uuid-2references/tools.mdreferences/nodes.mdsegmentchangefilterrecordIdsworkflowUuidfilerecords# Play workflow — run on a segment
cargo-ai orchestration batch create \
--workflow-uuid <play.workflowUuid> \
--data '{"kind":"segment","segmentUuid":"..."}'
# Tool workflow — run on a file
cargo-ai orchestration batch create \
--workflow-uuid <tool.workflowUuid> \
--data '{"kind":"file","s3Filename":"..."}'
# → Poll with: cargo-ai orchestration batch get <batch-uuid>
# Or wait synchronously — blocks until the batch reaches a terminal state and returns the final result
cargo-ai orchestration batch create \
--workflow-uuid <play.workflowUuid> \
--data '{"kind":"segment","segmentUuid":"..."}' \
--wait-until-finishedreleaseUuidcargo-ai orchestration release get <release-uuid>nodes[].slugcargo-ai orchestration batch download --uuid <batch-uuid> --output-node-slug <slug>cargo-ai orchestration batch cancel <batch-uuid>references/plays.mdreferences/tools.mdcargo-ai ai agent list # 1. Find the agent
cargo-ai ai chat create \ # 2. Create a chat
--trigger '{"type":"draft"}' \
--agent-uuid <agent-uuid> --name "Research session"
cargo-ai ai message create \ # 3. Send a message
--chat-uuid <chat-uuid> \
--parts '[{"type":"text","text":"Find the VP of Sales at Acme Corp"}]'
# → Extract assistantMessage.uuid, poll with: cargo-ai ai message get <uuid>
# Done when .message.status is "success" (read .parts) or "error" (read .errorMessage)--actions--resources--language-model-slug--temperature--max-steps--wait-until-finishedreferences/agents.md# List records for a workflow
cargo-ai orchestration record list --workflow-uuid <uuid> --limit 50
# Filter by batch or status
cargo-ai orchestration record list --workflow-uuid <uuid> --batch-uuid <uuid> --statuses error
# Count records
cargo-ai orchestration record count --workflow-uuid <uuid>
# Download records as a file
cargo-ai orchestration record download --workflow-uuid <uuid>
# Get per-node execution metrics
cargo-ai orchestration record get-metrics --workflow-uuid <uuid>
# Cancel records
cargo-ai orchestration record cancel --workflow-uuid <uuid> --ids record-id-1,record-id-2spansrunsbatchesrecordsorchestration query executerun get-metricsrun countcargo-ai orchestration query execute "SELECT count() FROM runs WHERE status = 'error'"
cargo-ai orchestration query execute "SELECT status, count() FROM batches GROUP BY status"
cargo-ai orchestration query execute "SELECT * FROM spans ORDER BY execution_started_at DESC LIMIT 10"spansrunsbatchesrecordsreferences/queries.md--model-uuid--segment-uuidmodelUuidsegment listconjonctionconjunctioncargo-ai segmentation segment fetch \
--model-uuid <uuid> \
--filter '{"conjonction":"and","groups":[]}' \
--fetching-limit 100 --fetching-offset 0--sort--enrich--syncreferences/filter-syntax.mdreferences/segments.md# Update a segment's name or filter
cargo-ai segmentation segment update --uuid <segment-uuid> --name "Updated Name"
cargo-ai segmentation segment update --uuid <segment-uuid> --filter '{"conjonction":"and","groups":[...]}'
# Remove a segment (fails if linked to a workflow)
cargo-ai segmentation segment remove <segment-uuid>template listtemplate get <slug>cargo-ai orchestration template list # list available templates
cargo-ai orchestration template get <slug> # get template nodes + configreferences/templates.mdcargo-ai orchestration node validate --nodes '[...]'
# → { "outcome": "valid" } or { "outcome": "notValid", "invalidNodes": [...] }node computenode executestatus: successrun.executions[].titlerun getrunContext.<nodeSlug>run get <run-uuid>references/troubleshooting.mdreferences/nodes.md--helpcargo-ai orchestration run create --help
cargo-ai orchestration template list --help
cargo-ai orchestration node validate --help
cargo-ai ai message create --help
cargo-ai orchestration query execute --help