Run a workflow on a single record
Prompt:cargo-ai orchestration tool list— findsworkflowUuidfor the enrichment toolcargo-ai orchestration run createwith the record data, waits for completion- Parses and presents the result
run create works with tool workflows only. For plays, use batch create
instead.Trigger a batch play across a segment
Prompt:cargo-ai orchestration play list— findsworkflowUuidandsegmentUuidcargo-ai orchestration batch createwith the segment- Polls
batch getevery 5 seconds until terminal status - Reports
runsCount,executedRunsCount,failedRunsCount
Query your data warehouse
Prompt:cargo-ai storage model list— finds the Companies model’s dataset and model slugscargo-ai storage model get-ddl <uuid>— gets the exact column names and types- Composes and executes a SQL query
Build a workflow from scratch
This example builds a workflow imperatively — assembling a raw node graph and
validating it with
node validate. For a versioned, reviewable workflow,
author it declaratively instead with
defineWorkflow in a CDK workspace and ship it with
cargo-ai cdk deploy. Use this imperative path for one-off or
agent-constructed graphs.cargo-ai connection connector list --integration-slug clearbit— findsconnectorUuidcargo-ai connection integration get clearbit— gets availableactionSlugvalues and their config schemas (viamanifest.actions.<actionSlug>.config.jsonSchema)cargo-ai storage model list— finds the Companies model UUID- Assembles and validates a node graph, then executes
Create and deploy an AI agent
Prompt:cargo-ai ai agent create— creates the agent resourcecargo-ai ai release get-draft— fetches the editable draftcargo-ai ai release update-draft— sets model, prompt, temperaturecargo-ai ai release deploy-draft— publishes the configuration
Monitor workflow health
Prompt:cargo-ai orchestration play list— findsworkflowUuidcargo-ai orchestration run get-metricswith a date range- Computes
errorExecutionsCount / totalExecutionsCountper node
48 / 1000 = 4.8%
Re-queue failed records:
Export segment data
Prompt:cargo-ai storage model list— finds the Companies model UUIDcargo-ai segmentation segment downloadwith filter and sort
Use
--model-uuid, not --segment-uuid. The filter and sort flags use the
same JSON schema as the Cargo UI segment builder.Bootstrap a new workspace
Prompt:Chat with an AI agent
Prompt:Track credit usage
Prompt:Invoice amounts returned by
subscription get-invoices are in cents. Divide
by 100 for dollars.Best practices
Verify authentication before every session
Verify authentication before every session
Run
cargo-ai whoami and share the output with your agent if it seems confused about which workspace to target. If you work across multiple workspaces, make the active one explicit with export CARGO_WORKSPACE_UUID=<uuid>.Front-load context about your workspace
Front-load context about your workspace
Start a session by telling your agent what exists: “I have Companies and
Contacts models, a HubSpot connector, and a lead enrichment tool called
‘Enrich from Clearbit’.” This lets the agent confirm UUIDs rather than
guessing, and saves multiple discovery round-trips.
Get the DDL before any SQL query
Get the DDL before any SQL query
The table name for a Cargo model is not guessable. Always run
storage model get-ddl <uuid> before writing queries. The DDL includes the exact table name (e.g., datasets_default.models_companies) and every column’s type.Ramp batch sizes gradually
Ramp batch sizes gradually
Start every new workflow with 1 record, then 50, then 500, before running on
your full segment. This surfaces connector rate limit issues before they
affect thousands of records. Only connector nodes (
kind: "connector") have
rate limits — native nodes do not.Always inspect failedRunsCount after a batch
Always inspect failedRunsCount after a batch
A batch reporting
status: "success" can still have individual run failures. Check failedRunsCount in batch get, download failures with run download --statuses error, and re-queue with batch create --data '{"kind":"recordIds","recordIds":[...]}'.Keep a .cargo-context.md for repeat tasks
Keep a .cargo-context.md for repeat tasks
For frequently used workflows or segments, note their UUIDs in a
.cargo-context.md in your project root. Your agent will use them directly instead of re-running discovery commands every session.Use --wait-until-finished for short operations
Use --wait-until-finished for short operations
For quick runs (single records, small batches under 100 records),
--wait-until-finished is the simplest pattern. For large batches (1000+ records), poll manually with batch get so your agent can report incremental progress without a timeout.Next steps
CLI Overview
Command reference, UUID flows, filter syntax, async patterns, and gotchas.
Cargo Skills on GitHub
Browse skill source, report issues, or contribute improvements.

