Skip to main content
Each example shows the plain-English prompt, what the agent does step by step, and the exact CLI commands it runs.

Run a workflow on a single record

Prompt:
What the agent does:
  1. cargo-ai orchestration tool list — finds workflowUuid for the enrichment tool
  2. cargo-ai orchestration run create with the record data, waits for completion
  3. 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:
What the agent does:
  1. cargo-ai orchestration play list — finds workflowUuid and segmentUuid
  2. cargo-ai orchestration batch create with the segment
  3. Polls batch get every 5 seconds until terminal status
  4. Reports runsCount, executedRunsCount, failedRunsCount
A batch with status: "success" can still contain individual run failures. Always inspect failedRunsCount and re-queue as needed.

Query your data warehouse

Prompt:
What the agent does:
  1. cargo-ai storage model list — finds the Companies model’s dataset and model slugs
  2. cargo-ai storage model get-ddl <uuid> — gets the exact column names and types
  3. Composes and executes a SQL query
In storage query, reference models as <dataset-slug>.<model-slug> (e.g. default.companies) — not the physical datasets_…/models_… name. Run model get-ddl first to confirm the available columns and types.

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.
Prompt:
What the agent does:
  1. cargo-ai connection connector list --integration-slug clearbit — finds connectorUuid
  2. cargo-ai connection integration get clearbit — gets available actionSlug values and their config schemas (via manifest.actions.<actionSlug>.config.jsonSchema)
  3. cargo-ai storage model list — finds the Companies model UUID
  4. Assembles and validates a node graph, then executes

Create and deploy an AI agent

Prompt:
What the agent does:
  1. cargo-ai ai agent create — creates the agent resource
  2. cargo-ai ai release get-draft — fetches the editable draft
  3. cargo-ai ai release update-draft — sets model, prompt, temperature
  4. cargo-ai ai release deploy-draft — publishes the configuration
Model selection guide:

Monitor workflow health

Prompt:
What the agent does:
  1. cargo-ai orchestration play list — finds workflowUuid
  2. cargo-ai orchestration run get-metrics with a date range
  3. Computes errorExecutionsCount / totalExecutionsCount per node
Response:
Error rate = 48 / 1000 = 4.8% Re-queue failed records:

Export segment data

Prompt:
What the agent does:
  1. cargo-ai storage model list — finds the Companies model UUID
  2. cargo-ai segmentation segment download with 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:
What the agent does (full sequence across 4 skills):

Chat with an AI agent

Prompt:

Track credit usage

Prompt:
Group by connector to see which enrichment provider costs the most:
Check remaining credits:
Invoice amounts returned by subscription get-invoices are in cents. Divide by 100 for dollars.

Best practices

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>.
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.
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.
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.
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":[...]}'.
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.
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.