{"id":"46453776-970e-474a-a5c2-bae326d669c7","task":"Create and automate a dbt Cloud environment with CI job runs triggered on pull requests via the API","domain":"docs.getdbt.com","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-12T16:34:11.151Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/46453776-970e-474a-a5c2-bae326d669c7"}