Skill v1.0.0
currentLLM-judged scan90/100version: "1.0.0" name: debug-failed-job description: Find out why a Keboola job failed and propose a fix. Use when the user says a Keboola job, extractor, transformation, writer or flow failed or errored, or asks why their pipeline is red.
Debug a failed job
Find the failed job, read its error and logs, explain the cause, and fix it only after the user agrees.
Input
A job ID, a configuration or flow name, or just "my last job failed". Ask for nothing more until step 4 shows whether it is needed.
Steps
- Pick the project. Call
get_accessible_projects(withwith_llm_instruction=trueon the first call in the
conversation) and ask the user which project the job ran in. Do not guess. Do this even when the session looks scoped already or a data tool would work without it: this plugin always narrows the session to the projects the user confirms. If get_accessible_projects fails because no programmatic token is present, the login is bound to one project: confirm it with the user and skip step 2.
- Scope the session to that project. Call
set_project_scopewithproject_ids=[<the confirmed id>]. This
must happen before any write in step 7. If the result carries a non-null scope_token, pass it on every later tool call. Every write in step 7 also passes the confirmed id as project_id: other conversations on the same login share the scope, and a scope they moved makes the write fail instead of landing in another project.
- Find the job.
- Known job ID: go to step 4.
- Known configuration or flow name: find its ID with
search(`item_types=["configuration", "transformation",
"flow"]), then call get_jobs with job_ids=[], status="error", component_id=... and config_id=...`.
- Nothing known: call
get_jobswithjob_ids=[],status="error"andlimit=10, and ask the user which job
they mean if more than one is recent.
- Read the failure. Call
get_jobswithjob_ids=["<id>"],include_logs=trueand
log_event_types=["error", "warn"]. If the error event is not enough, call again with a larger log_tail_lines=... and no event type filter.
- Read what ran. Call
get_configswithconfigs=[...]for the job's configuration. For a flow job, call
get_flows with flow_ids=[...] and find the failed task, then repeat steps 3 and 4 for that task's job.
- Explain. Name the cause in one or two sentences and quote the error line. Typical causes: an SQL error in
a transformation (check columns with get_tables and reproduce the failing SELECT with query_data), a missing input table, expired credentials of an extractor or writer, or a schema change in the output table. Use docs_query for component-specific errors. Propose a fix.
- Fix, only on request. Ask before changing anything.
- SQL transformation:
update_sql_transformationwithproject_id=<the confirmed id>, its
configuration_id=..., the parameter_updates=[...] and a change_description=....
- Flow:
modify_flowwithproject_id=<the confirmed id>, itsconfiguration_id=..., theflow_type=...it
already has and a change_description=....
- Another component:
get_componentsfor its schema. When the fix belongs in a configuration row, call
update_config_row with project_id=<the confirmed id>, component_id=..., configuration_id=..., configuration_row_id=... and a change_description=.... Otherwise call update_config with project_id=<the confirmed id>, component_id=..., configuration_id=... and a change_description=....
- Expired OAuth credentials need the user: create a link with
create_oauth_url,
project_id=<the confirmed id>, component_id=... and config_id=..., and ask them to reauthorize.
Then, with the user's consent, call run_job with project_id=<the confirmed id>, component_id=... and configuration_id=..., and check the new job with get_jobs. If the server refuses a write because the user's role is read-only, give the user the proposed fix to pass to a project admin.
Rules
- No write before step 2, and no write at all without the user's go-ahead.
- Never rerun a job just to see whether it fails again; read the logs first.
- Report what the logs say. If they do not show a cause, say so and list what you checked.