Terraform Cloud "run tasks ... failed" in CI
A run task is an external integration HCP Terraform calls at a stage of the run. A mandatory (enforced) run task that returns a failing result stops the run, even though plan itself succeeded.
What this error means
A remote run passes plan but fails at the run tasks stage, showing one or more integrations (security scan, drift check) reporting a failed status.
Run tasks failed. 1 of 1 run task failed.
security-scan (post-plan, mandatory): FAILED
- 2 high-severity findings must be resolved.Common causes
A mandatory run task returned a failing result
An enforced run task (scanner, cost tool, custom check) reported failure, and enforcement blocks the run.
The run task endpoint errored or timed out
If the external service is unreachable or slow, the task can fail on infrastructure rather than policy.
How to fix it
Resolve the run task findings
- Open the run task result linked from the run.
- Fix the findings it reports (vulnerabilities, drift, cost).
- Re-run so the task passes.
Check the run task integration health
If the task failed to run rather than reporting findings, verify the external endpoint and its HMAC/URL configuration on the workspace or organization.
How to prevent it
- Set run tasks to advisory until the integration is proven stable.
- Keep the run task endpoint and secret configuration current.
- Surface run task findings in PRs so they are fixed before apply.