Create a CI/CD environment in dbt Cloud under Deploy > Environments; set the environment type to Staging and configure it to run against a dedicated schema or database to isolate CI runs from production
Create a job under that environment with job type set to CI (Continuous Integration) so dbt Cloud automatically clones the repo at the PR commit and runs against a temporary schema named after the PR number
Use the dbt Cloud API to trigger the CI job manually or via webhook: POST to https://cloud.getdbt.com/api/v2/accounts/{account_id}/jobs/{job_id}/run/ with body {"cause": "PR #42", "git_sha": "abc123", "schema_override": "dbt_pr_42"}; include the commit SHA to pin the run to the PR head
Poll the run status endpoint GET https://cloud.getdbt.com/api/v2/accounts/{account_id}/runs/{run_id}/ until status is 10 (success) or 20 (error); on completion, post the run URL back to the pull request as a status check comment using your VCS API
On status 10, verify no dbt test failures by checking GET .../runs/{run_id}/artifacts/run_results.json for any results with status 'fail' or 'error' in the results array
Known gotchas
CI jobs in dbt Cloud create temporary schemas that must be cleaned up after the PR merges; dbt Cloud does not automatically drop CI schemas — implement a cleanup job or use database TTL policies to avoid schema sprawl
The schema_override parameter changes the target schema but not the database; if your project uses database-level isolation between environments, supply the database value in the environment variables passed via the API payload
dbt Cloud free developer plans have rate limits on API requests; teams running many concurrent PRs should implement request queuing or use Webhooks (where dbt Cloud pushes run events to your endpoint) instead of polling to avoid hitting rate limits
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp