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

17 Nov6min 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

Each step below has its own page. For the argument first, read your GTM belongs in git and the manifesto.

How can revenue logic be versioned, tested, reviewed and rolled back like software? #

By writing it down as files before you automate it. List the revenue processes that run often enough to matter (qualification, enrichment, scoring, routing, a CRM write-back) and record four things for each: its inputs (first-party and third-party data), the context it depends on (ICP, personas, plays, kept as markdown in context/), its decision (a threshold, a routing rule, an agent prompt) and its checkpoints (how a change is tested, reviewed, deployed and undone). Andrew Straus put the bar plainly in Operations as Code: such a process should be “version-controlled config, reviewed like a pull request, tested against production data, and deployed with a rollback path.”

What to look for in a GTM as code platform #

Five questions matter: is the definition declarative, is there a plan before the apply, do data models, workflows and agents live in one language and repository, is there a way back, and can a coding agent operate it? In Cargo, each resource is a TypeScript define* call, cargo-ai project plan prints the diff, deploy applies it, rollback restores the deploy state record, and the web app, CLI, REST API and MCP server all change one workspace.

A visual workflow builder can run the same logic, and it is often right for one person with a handful of workflows. The difference is how a change is made and undone: in a builder, saving is deploying and undo means rebuilding from memory; in code, a change is a reviewed diff and undo is a revert. Code pays once several people or agents change the same engine.

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 #

One define* call per resource (defineModel, defineSegment, definePlay, defineTool, defineAgent, connectors), and imports are the dependency graph. The scaffold is the open-source Cargo template: context/, infra/, evals/ and outputs/. cargo-ai project pull generates source from an existing workspace. The projects page lists every resource, and the cargo-project skill teaches a coding agent the workflow.

How do GTM teams manage revenue workflows through GitHub pull requests? #

The repository is the source of truth and the pull request is the only door into production:

  1. Branch and edit. Often a coding agent changes a define* file.
  2. Open the pull request. The Cargo check diffs it against the deploy state (+ create, ~ update, = noop, - delete) and adds what the merge will set in motion: the records each play runs on, the messages it can send and the credits it can spend.
  3. Run the tests. Evals in evals/ run in CI for any change to an agent or prompt.
  4. Approve. 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).
  5. 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, one deploy at a time, with no workflow file and no Cargo token in GitHub. Your own CI can run the same two commands instead.
  6. Revert if needed. git revert and a deploy reconcile the workspace to whatever the code says.

Every behaviour traces back to a reviewed commit. See Cargo + GitHub.

One-off jobs, tests and the graph #

A pilot of 50 contacts, a CSV import or a backfill is an execution: defineBatch or defineRun under outputs/. The plan lists it, the next deploy runs it, and a ledger makes sure it never runs twice. An agent’s system prompt is a string in a defineAgent file, tested with the scaffold’s promptfoo suite (npm run eval) and scored in production by the agent’s evaluator. cargo-ai project graph draws every resource as a Mermaid flowchart, and --plan colours what the next deploy changes.

Custom revenue logic: workflows and agents are different tools #

Workflows (Cargo’s tools and plays) are configured logic: typed inputs, one unit of work, typed outputs, the same path every time. Agents make judgements: they read context and data and act through the tools you gave them. Use a workflow when the rule can be written down and an agent when the decision needs reading. Both read and write the same unified records (companies, contacts, deals, custom objects), synced from the CRM, the product and enrichment providers, so an operator in the web app, an engineer in a terminal and an agent over MCP see the same account in the same state. The GTM infrastructure guide compares the other ways to build this.

What this is not #

It is not a way around review. Merging is the approval, so protect the production branch 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. See what moves first.

FAQ #

Running your revenue engine as version-controlled software: data models, enrichment, scoring, routing, plays and AI agents declared in files, reviewed as diffs and deployed by a merge. It is infrastructure as code applied to go-to-market.

No. A repository connected in Settings → States is planned and deployed by Cargo itself. 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.

~/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
AurelienAurelienNov 17, 2026
On this page
  • How can revenue logic be versioned, tested, reviewed and rolled back like software?
  • What to look for in a GTM as code platform
  • The lifecycle, one job per page
  • 1. Declare it
  • How do GTM teams manage revenue workflows through GitHub pull requests?
  • One-off jobs, tests and the graph
  • Custom revenue logic: workflows and agents are different tools
  • What this is not
  • FAQ

Stay Informed with our
weekly Newsletter

Related articlesSee all articles
GTM Engineering
Build vs Buy: Scaling Your GTM Engineering Stack in 2026

When a GTM engineering team should build revenue infrastructure in-house and when to buy a platform: what the second year of a custom stack costs, where the line sits layer by layer, and what one system can honestly replace.

AurelienAurelien·Nov 17, 2026
GTM Engineering
Building a Self-Driving GTM Engine with Agentic Infrastructure

Agentic GTM infrastructure is what a self-driving GTM engine runs on: AI agents defined and deployed as code, orchestration workflows callable from the UI, the CLI, the API and agents, and one unified data model behind lead routing and scoring.

AurelienAurelien·Nov 17, 2026
GTM Engineering
What is GTM infrastructure? The layer underneath your agents

GTM infrastructure is the layer a revenue engine runs on: one data model, typed tools, plays that fire on data, agents, and context, defined in code instead of clicked into a UI. What it is, what it is not, and how to tell whether you have it.

AurelienAurelien·Nov 17, 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 GojiberryCargo x PhantomBusterCargo x ZapierCargo x ApolloCargo x Chili PiperCargo x Common RoomCargo x MakeCargo x Tray.io

Company

ManifestoCommunityEventsJobsPartners DirectoryPartner Program

Legal

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

$ npm install -g @cargo-ai/cli