/orchestra:fix-pipeline-python-taskfrom orchestra
Fixes a failed Python task in an Orchestra pipeline by editing the script, adjusting dependencies, or making additive schema changes. Re-runs until the task passes.
Ships in orchestra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Locate the script → check what it lands → fix → validate → confirm → merge/save. Narrate each step briefly, like a data engineer. Never print secrets/tokens.
MCP is preferred but optional. If the Orchestra MCP tools aren't present, use the public REST API with $ORCHESTRA_API_KEY (check the env — often already set). For git, $GITHUB_TOKEN is usually set. For schema checks you also need a warehouse credential (Snowflake/BigQuery) or S3/object-store credential — ask the user if not present.
If neither MCP nor an Orchestra key is available, point the user at the Orchestra MCP setup docs (https://docs.getorchestra.io/docs/mcp) or ask for an API key, then stop.
Base: https://app.getorchestra.io/api/engine/public — header Authorization: Bearer $ORCHESTRA_API_KEY.
identify-pipeline-error hands you: the pipeline run ID (RID), pipeline ID (PID), the failed Python task run ID (TRID), integration=PYTHON, the run branch/commit, the task's taskParameters, and the cause classification (a Python code / dependency / destination-schema issue). Use them directly — don't re-run the identification.
If invoked standalone (no handoff): run identify-pipeline-error first, or do its minimum yourself — GET /pipeline_runs/<RID> then GET /task_runs?pipeline_ids=<PID>&page_size=50&time_from=<now-7d>&time_to=<now> (filter to this RID client-side; pipeline_run_ids does not filter /task_runs, defaults to the last 24 hours without the window) to find the FAILED Python task.
Capture taskParameters exactly — command/entrypoint, python_version, package_manager, requirements, branch, project_dir, and any env/run inputs. Preserve them on every retry. The pipeline run's branch is where the Orchestra YAML lives; the script's source branch (if git-backed) is a separate task param.
Pull the logs you'll fix against:
GET /pipeline_runs/<RID>/task_runs/<TRID>/logs # list filenames
GET /pipeline_runs/<RID>/task_runs/<TRID>/logs/download?filename=<file> # URL-encode spaces
Read the Python traceback bottom-up: the last exception line is the real error, not the first.
You were routed here because the cause is a Python code / dependency / destination-schema issue — fix the script (and, additively, the destination shape, §4). If while reproducing you find the real cause is not that — an infra/timeout/memory problem, or a pure upstream failure (source API down, empty extract) you can't fix from here — stop and hand back to identify-pipeline-error rather than editing the script. Data/schema mismatches (the script writes a shape the destination rejects) are in scope: handle them additively in §3–4.
Python tasks come in two shapes; handle both:
branch + project_dir + a file/entrypoint): clone and reproduce locally.
git clone --depth 1 -b <branch> https://x-access-token:[email protected]/<org>/<repo>.git
cd <repo>/<project_dir> && pip install -r requirements.txt
python <entrypoint> # reproduce; iterate edit → run
get/list_pipelines, or the Orchestra YAML if it's stored in git). You'll fix it in the pipeline definition (Orchestra-backed → update_pipeline; or edit the inline command). State clearly to the user that this script isn't version-controlled and recommend they back it into git so it can be PR'd and CI-tested.Either way: heavy bias toward making it actually run. Edit → execute → read the next error → repeat, exactly like fixing layered dbt bugs. Don't declare it unfixable after one error; the first traceback usually masks the next.
Python tasks almost always drop data into a warehouse or S3. Before and after a fix, confirm the actual landed shape rather than trusting the script's intent.
SELECT column_name, data_type FROM <db>.INFORMATION_SCHEMA.COLUMNS
WHERE table_schema='<SCHEMA>' AND table_name='<TABLE>'; -- or DESCRIBE TABLE
SELECT COUNT(*) FROM <db>.<schema>.<table>; -- did rows actually land?
Compare the columns/types the script writes against what's there. A schema-mismatch failure is the signal to evolve the destination — additively.
Bias strongly toward upward-compatible schema changes; never destroy data or shape:
ALTER TABLE ... ADD COLUMN for a new field; widen a type (e.g. INT→NUMBER, VARCHAR(50)→VARCHAR(200)); add a new partition/prefix.DROP/DELETE/TRUNCATE, no renaming/removing columns, no narrowing types, no recreating the table to "fix" it.update_pipeline (Orchestra-backed) or edit the inline command; tell the user it's not version-controlled.POST /pipelines/<PID>/start
{ "branch": "<yaml-branch>",
"continueDownstreamRun": true,
"runInputs": { ... preserve original params ... } }
python → dbt → reverse-ETL/BI — the data it lands is what every downstream task consumes. A full /start (no taskIds) runs the entire DAG top-to-bottom — prefer it, because it proves dbt and downstream actually accept the new output. If you target just the failed task ("taskIds": ["<TID>"]) or use "retryFromFailed": true, you must also send "continueDownstreamRun": true, or the load succeeds in isolation while dbt/BI never re-run — and a schema change you just made (§4) goes unverified downstream.Poll GET /pipeline_runs/<RID> (MCP get_pipeline_run) ~every 20s, one line per check:
▶ Run e2049b86 — RUNNING (0:42)
✅ Run e2049b86 — SUCCEEDED (1:44)
A very-fast SUCCEEDED can be a stale first read — re-check completedAt/message. On failure, diagnose the new error (getting further is progress) and loop to §3.
Confirm the whole pipeline, not just the Python task. "Fixed" means the pipeline run is SUCCEEDED with every task green — list its task runs (GET /task_runs?pipeline_ids=<PID> filtered to the RID) and confirm none are FAILED. The most common trap: the Python load goes green but the downstream dbt task fails because it didn't expect the new/changed column — that's exactly why you run downstream (and why schema changes must be additive, §4). Then also verify the data landed (§4: row count > 0, expected columns present) — a Python task can exit 0 yet write nothing. When green end-to-end, merge the PR (or finalise the inline fix), and re-run with the original params to prove the real config works.
## Fixed: <pipeline name>
- Final run: <id> — SUCCEEDED
- Root cause: <one line>
- Fixes: <script change(s); any additive schema change with the DDL>
- Data check: <table/prefix — N rows, columns confirmed>
- PR / definition: <link or "inline, not version-controlled — recommend backing to git">
/start by default; for targeted/retryFromFailed retries always add "continueDownstreamRun": true, and confirm every task in the run is green — a Python fix isn't done until the downstream dbt/BI tasks accept its output.update_pipeline; GitHub-backed need repo commits.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
19 skills in this plugin
/account-health-checkAudit an Orchestra workspace/account against Orchestra's best practices and produce a read-only health report — findings grouped by area, each tagged with severity, evidence, and a fix recommendation, written to a markdown file plus a chat summary. Use whenever the user wants an "account review", "workspace audit", "health check", "best-practice review", "onboarding review", or asks "is my Orchestra set up correctly?", "what should I improve?", "are we following best practices?", "review my pipelines", or "audit my workspace". Also trigger when the user mentions reviewing pipeline design, environment/promotion setup, Git/CI-CD coverage, alerting coverage, connections/secrets hygiene, concurrency, cost, RBAC, repeated tasks (MetaEngine), metadata/lineage, auto-fix agents, or hybrid-deployment fit across their Orchestra account. This skill only inspects and reports — it never edits pipelines or changes settings.
/build-data-reconciliation-pipelineBuilds Orchestra pipeline YAML using the native Data Reconciliation tasks (DATA_RECONCILIATION_MANUAL_QUERY, DATA_RECONCILIATION_CURSOR_FIELD) to prove two data stores match — the "did the migration land correctly" check between a source and destination integration (SNOWFLAKE, SQL_SERVER, DATABRICKS, any pairing). Use whenever the user wants to compare, validate, or reconcile data across two systems for a migration, replatform, cutover, or CDC/replication setup — phrases like "make sure the migration matches", "reconcile Snowflake and Databricks", "validate the cutover", "did we lose any rows moving to the new warehouse", "set up drift monitoring", or any mention of Data Reconciliation / DataRec. Produces a one-off full-match validation pipeline plus, optionally, an ongoing cursor-field drift monitor. Don't use create-orchestra-pipeline for this — Data Reconciliation tasks have sharp edges (single-scalar results, thresholds that silently no-op if omitted) covered in this skill's references.
npx claudepluginhub orchestra-hq/orchestra-skills --plugin orchestraOther plugins' skills for the same job