Office hours: Build your self-driving GTM engine·Oct 29, 9:00am PT, onlineRegister→
Cargo
  • PrimitivesData ModelsYour companies, contacts and deals, merged from every sourceContextWhat your team knows, as files every agent readsTerritoriesWho sells where, defined onceMailboxesMailboxes in your reps' names, warmed up and kept under limitsToolsThe actions your agents, plays and reps callAgentsAI that researches, decides and writes, reading your contextPlaysWorkflows that run on a trigger or a schedule, with retriesAppsInternal apps for your reps, hosted on Cargo
    Add-onsChrome ExtensionSell faster, right in your browserButtonTrigger AI agents inside your CRMFormTurn any tool into an embeddable formSlackTag Cargo in Slack. It does the GTM workGitHubPlan on every pull request, deploy on merge
    MoreProjectsDefine your entire GTM in codeCLIUse Cargo from your terminalMCPUse Cargo from Claude and ChatGPTDeveloper resourcesCargo API docs, OpenAPI spec, auth docs, webhooks, MCP serverAPI ReferenceExplore the Cargo APIDocumentationLearn how to use CargoIntegrationsConnected to your entire GTM stack
  • VeriffHow Veriff replaced MuleSoft with Cargo under NetSuite, Stripe and SalesforceAugmentHow Augment Code routes developer sign-ups to reps in under an hourWeights & BiasesHow Weights & Biases ships a new purchase signal in 2 days on CargoSee all
  • Pricing
  • Cookbooks
  • Blog
Sign in
Blog

GTM as Code: The Complete Guide to Running Your Go-to-Market as Code

16 Oct6min read
AurelienAurelien

To run your go-to-market as code, declare your data models, plays, tools and agents in TypeScript as a Cargo project in a git repository, then connect that repository to Cargo: every pull request is planned and previewed as a comment, and every merge deploys. cargo-ai project init scaffolds the repository, and the rest is the pull request workflow your engineers already use.

shellscript
npm install -g @cargo-ai/cli
cargo-ai login --email you@company.com   # no browser, 100 free credits, no card
cargo-ai project init acme-gtm           # scaffold the repository and its deploy state
cd acme-gtm
cargo-ai project plan                    # the diff a pull request will show
cargo-ai project deploy                  # apply it, or let the merge do it

This page is the map. Each step of the lifecycle below has its own page with the commands, what comes back, and the limits. If you want the argument for working this way first, read your GTM belongs in git and the manifesto.

The lifecycle, one job per page #

You want toCommand or settingRead
Put the go-to-market stack in gitcargo-ai project init, cargo-ai project pullVersion-control your go-to-market stack in git
See what a merge will send and spendthe plan comment on each pull requestPreview what a change will send
Deploy when a pull request mergesSettings → States → connect a repositoryDeploy go-to-market changes on merge
Run a one-off batch or run, exactly oncedefineBatch, defineRun in outputs/Declare one-off batches and runs in code
Test an agent or a prompt before it shipsnpm run eval in CI, evaluator on defineAgentEvaluate an agent before production
See every resource and how it connectscargo-ai project graphDraw your go-to-market resource graph
Undo a changegit revert, then deployRoll back a go-to-market change

1. Declare it #

The engine is TypeScript: one define* call per resource (defineModel, defineSegment, definePlay, defineTool, defineAgent, connectors), and imports are the dependency graph. The scaffold from cargo-ai project init is the open-source Cargo template layout: context/ for what the company knows, infra/ for what runs, evals/ for prompt tests and outputs/ for what happened. An existing workspace does not have to be rewritten by hand: cargo-ai project pull generates define* source from it. The projects page lists every resource a project can declare, and the cargo-project skill teaches a coding agent the same workflow.

2. Review it before it ships #

cargo-ai project plan compiles the repository and diffs it against the deploy state your workspace holds: + create, ~ update, = noop, - delete. Once the repository is connected, Cargo runs that plan on every pull request and adds what the merge will set in motion: the records each play and one-off execution runs on, the emails, LinkedIn actions and messages it can send, and the credits it can spend. Above 100 emails, 100 LinkedIn actions, 100 chat messages, 5,000 audience adds or 2,500 credits, the check fails until a reviewer adds the cargo:approve-impact label (thresholds as defined in Cargo’s code, October 2026).

3. Ship it on merge #

Connect the repository in Settings → States and every push to the production branch runs cargo-ai project deploy --yes on that commit, as a service user with a credential minted for the run. There is no workflow file to write and no Cargo token stored in GitHub. Deploys of one project apply one at a time, in order. If you prefer your own CI, the same two commands, cargo-ai project plan and cargo-ai project deploy, run there.

4. Run one-off jobs from the same repository #

Not everything is a standing play. A pilot enrollment of 50 contacts, a CSV import or a backfill is an execution: defineBatch or defineRun in a file under outputs/. The plan lists it, the next deploy runs it, and a ledger in the deploy state makes sure it never runs twice.

5. Test the agents #

An agent’s system prompt is a string in a defineAgent file, so a pull request can change it. The scaffold ships an evals/ folder with a promptfoo configuration and a case template; run it with npm run eval on every pull request that touches an agent, next to Cargo’s own check. In production, the agent’s evaluator scores each finished turn against a rubric.

6. See it and undo it #

cargo-ai project graph draws every resource and what it points at as a Mermaid flowchart, from the live workspace or offline from the repository, and --plan colours what the next deploy changes. When a change goes wrong, revert the commit: the deploy reconciles the workspace to whatever the code says.

What this is not #

It is not a way around review. Merging is the approval: the deploy runs whatever reached the production branch, so protect that branch the way you protect production, and make the Cargo check required. It is also not a full replacement for the UI. Resources deployed from code stay editable in Cargo, and the project never reads those edits back, so pick one owner per resource. Why GTM teams should migrate their stack to git covers what moves first and what stays in the UI.

FAQ #

GTM as code (go-to-market as code) is running your revenue engine as version-controlled software: data models, enrichment, scoring, routing, plays and AI agents declared in files, reviewed as diffs in pull requests, and deployed by a command or a merge. It is the infrastructure-as-code pattern applied to go-to-market.

Five cover the lifecycle: cargo-ai project init to scaffold, cargo-ai project plan to diff, cargo-ai project deploy to apply, cargo-ai project graph to draw the result, and cargo-ai project rollback to restore the deploy state record after a bad deploy.

No. A repository connected in Settings → States is planned and deployed by Cargo itself, with no workflow file in the repository. Remove an older .github/workflows/cargo-deploy.yml when you connect: with Deploy on push on, Cargo refuses deploys from anyone but the connection’s service user.

No. GTM here means go-to-market. Nothing on this page manages Tag Manager containers.

~/run-it-on-cargo/

Build this workflow instead of reading about it.

Cargo is the GTM infrastructure your coding agent builds on: enrichment, scoring, routing and outreach, defined in code and run in production.

Start building
AurelienAurelienOct 16, 2026
On this page
  • The lifecycle, one job per page
  • 1. Declare it
  • 2. Review it before it ships
  • 3. Ship it on merge
  • 4. Run one-off jobs from the same repository
  • 5. Test the agents
  • 6. See it and undo it
  • What this is not
  • FAQ

Stay Informed with our
weekly Newsletter

Related articlesSee all articles
GTM Engineering
CI/CD for Go-to-Market: What It Means and How to Set It Up

CI/CD for GTM means every change to enrichment, scoring, routing and sequences ships as a pull request that is planned, checked, approved, deployed on merge, logged and reversible. What each software CI/CD step becomes for go-to-market, and how to set it up on Cargo.

AurelienAurelien·Nov 3, 2026
GTM Engineering
Require Approval Before a High-Impact Go-to-Market Change Goes Live

How Cargo holds a go-to-market pull request that would send or spend more than set limits until a reviewer adds the cargo:approve-impact label: the thresholds, what counts as high impact, who should approve, and what the gate does not catch.

AurelienAurelien·Nov 3, 2026
GTM Engineering
Test a Go-to-Market Change Before It Reaches Production

How to test a change to enrichment, scoring, routing or outreach before it runs on every lead: check the project offline, dry run an action, read the plan on the pull request, ship the play switched off and pilot it on 50 records, evaluate agents, and use a second workspace as staging.

AurelienAurelien·Nov 3, 2026

Build the self-driving GTM engine

Your coding agents build it on Cargo.Or our team builds, operates and improves it with you.

Start building
Cargo
Backed byY CombinatorSOC 2 Type IICertified
LinkedinX

Product

Data ModelsContextTerritoriesMailboxesToolsAI AgentsPlaysAppsIntegrationsPricing

Add-ons

Chrome extensionButtonFormSlackGitHub

Build

DocsDeveloper resourcesCargo API docsCargo OpenAPI specCargo auth docsCargo webhooksCargo MCP serverProjectsClaude CodeCodexCursorAll coding agents

Resources

ReportsBlogCustomer storiesCookbooksEnrichmentRoutingSignalsScoringCRM hygieneAd audiencesGTM skillsGTM EngineeringGlossaryCompareCargo x ClayCargo x WorkatoCargo x n8nCargo x DeeplineCargo x DefaultCargo x LeanDataCargo x UnifyCargo x ValleyCargo x Gojiberry

Company

ManifestoCommunityEventsJobsPartners DirectoryPartner Program

Legal

SecurityTerms of servicePrivacy PolicyRefundsDPASupport
© 2026 Cargo
 ////////    ///////    ////////     ////////    ///////
///         ///   ///   ///   ///   ///         ///   ///
///         ///   ///   ///   ///   ///         ///   ///
///         /////////   ////////    ///  ////   ///   ///
///         ///   ///   /// ///     ///   ///   ///   ///
///         ///   ///   ///  ///    ///   ///   ///   ///
 ////////   ///   ///   ///   ///    ///////     ///////

$ npm install -g @cargo-ai/cli