This prompt is built for data engineers and platform operators who need to restart a failed batch or streaming pipeline from the last successful checkpoint. It takes the checkpoint metadata, the failure error, and the pipeline DAG, then returns a safe restart point and any state-repair instructions. The goal is to minimize data loss and avoid duplicate processing while giving the operator a clear, auditable recovery path.
Prompt
Data Pipeline Checkpoint Recovery Prompt

When to Use This Prompt
Define the job, the user, and the boundaries for safe checkpoint recovery in failed data pipelines.
Use this prompt when a pipeline run has failed with a specific error, the checkpoint system has recorded a last-committed offset or watermark, and you need to decide whether to resume from that point, rewind, or skip a poisoned segment. The prompt works best when you can provide structured context: the checkpoint timestamp or sequence number, the exact error message and stack trace, the pipeline topology (source, transforms, sinks), and any exactly-once or at-least-once delivery guarantees. It is designed for integration into runbook automation, where the output feeds directly into a restart script or an operator's decision dashboard.
Do not use this prompt when the failure is a systemic infrastructure outage (e.g., network partition, storage unavailability) rather than a data or logic error. It is not a replacement for a dead-letter queue or a schema registry. Avoid using it for pipelines that lack checkpointing entirely—if there is no recorded state, the prompt cannot invent a safe restart point. In regulated environments where exactly-once semantics are auditable, always route the prompt's output through a human approval step before executing a restart. The prompt's confidence score and state-repair instructions are advisory, not a substitute for verifying that reprocessing won't violate delivery guarantees.
Use Case Fit
Where the Data Pipeline Checkpoint Recovery Prompt works, where it fails, and what you must provide before using it in production.
Good Fit: Deterministic Pipeline Failures
Use when: The pipeline failed on a known, deterministic error (e.g., schema mismatch, resource exhaustion, data corruption at a specific offset). The prompt excels at parsing structured error logs and checkpoint metadata to calculate a safe restart point. Guardrail: Always verify the suggested offset against the actual last-committed offset in your message queue or file system before resuming.
Bad Fit: Non-Deterministic or Transient Errors
Avoid when: The failure is a transient network timeout, a race condition, or an OOM kill that left no clean checkpoint. The prompt cannot reliably reconstruct state from a corrupted or missing checkpoint file. Guardrail: Implement a circuit breaker in the harness. If the checkpoint metadata is missing or the error is classified as transient, bypass the prompt and use a standard exponential backoff retry.
Required Input: Structured Checkpoint Metadata
What to watch: The prompt hallucinates a restart point if it receives only a natural language description of the failure. It requires machine-readable metadata (e.g., Kafka offsets, file path + line number, batch ID). Guardrail: The harness must validate that the [CHECKPOINT_METADATA] input contains a parseable timestamp, offset, or sequence number before calling the model. Reject the request if the input is unstructured.
Operational Risk: Exactly-Once Violation
Risk: The prompt suggests a restart point that is too early, causing duplicate records and violating exactly-once semantics. This is common when the failure occurred mid-batch. Guardrail: The prompt output includes a reprocessing_risk flag. The harness must enforce a strict rule: if reprocessing_risk is high, block automatic resumption and route to a human operator for manual offset verification.
Operational Risk: State Repair Side Effects
Risk: The prompt generates state-repair instructions (e.g., DELETE FROM temp_table WHERE batch_id = X) that are unsafe to run automatically. Guardrail: Treat all state_repair_instructions as read-only suggestions. The harness must log them and require explicit human approval before executing any DDL, DML, or filesystem mutation commands.
Bad Fit: Multi-Pipeline Fan-Out Failures
Avoid when: A single source failure cascaded into multiple downstream pipeline failures. The prompt analyzes one DAG at a time and cannot coordinate a global recovery point across fan-out dependencies. Guardrail: For cascading failures, use a separate orchestration-layer recovery workflow. This prompt is only safe for single-pipeline, leaf-node recovery.
Copy-Ready Prompt Template
A reusable prompt template for recovering a failed data pipeline from its last successful checkpoint, diagnosing state, and producing safe restart instructions.
This template is the core instruction set you'll send to the model when a batch or streaming pipeline fails. It forces the model to reason about checkpoint metadata, the specific failure error, and the pipeline's directed acyclic graph (DAG) before suggesting a restart point. The output is designed to be parsed by an orchestration tool like Airflow or Dagster, so the structure is strict. Use this prompt as a starting point; you will need to populate the placeholders with data from your pipeline's execution context and monitoring systems before every call.
textYou are a data reliability engineer diagnosing a failed data pipeline. Your task is to analyze the provided checkpoint metadata, the failure error, and the pipeline DAG to determine a safe restart point and any required state-repair instructions. Your primary goal is to minimize data loss and duplicate processing. You must explicitly check if the proposed restart would violate exactly-once processing semantics and issue a clear warning if it does. ## INPUTS - **Pipeline DAG:** A representation of the task dependencies. [DAG_DEFINITION] - **Last Successful Checkpoint:** Metadata about the last completed task before failure. [CHECKPOINT_METADATA] - **Failure Error:** The full error message and stack trace from the failed task. [FAILURE_ERROR] - **Pipeline Execution Context:** Runtime parameters, environment variables, and run ID. [EXECUTION_CONTEXT] ## CONSTRAINTS - Prioritize data integrity over speed. - If a safe restart point cannot be determined with high confidence, recommend a full backfill from the last verified clean state instead of guessing. - The output must be a valid JSON object matching the specified schema. - [ADDITIONAL_CONSTRAINTS] ## OUTPUT_SCHEMA { "diagnosis": { "root_cause_category": "string (e.g., DATA_CORRUPTION, DEPENDENCY_FAILURE, RESOURCE_EXHAUSTION, SCHEMA_DRIFT)", "failed_task_id": "string", "summary": "string" }, "recovery_plan": { "recommended_action": "RESTART_FROM_CHECKPOINT | SKIP_TASK | FULL_BACKFILL | MANUAL_INTERVENTION", "restart_point_task_id": "string | null", "state_repair_instructions": [ { "task_id": "string", "action": "string (e.g., DELETE_PARTITION, RESET_OFFSET, CLEAR_TEMP_TABLE)", "details": "string" } ], "exactly_once_violation_warning": "string | null" }, "confidence_score": 0.0-1.0, "requires_human_approval": true | false }
To adapt this template, start by replacing the [DAG_DEFINITION] placeholder with a structured representation of your pipeline, such as a JSON list of tasks and their dependencies. The [CHECKPOINT_METADATA] should include the last completed task's ID, its output partition or offset, and a timestamp. For streaming pipelines, this is often a Kafka offset or a Kinesis sequence number. The most critical adaptation is the [ADDITIONAL_CONSTRAINTS] field; use it to inject your organization's specific data retention policies, SLAs, or regulatory rules that might override a purely technical recovery path. After running the prompt, always validate the output against the OUTPUT_SCHEMA before passing it to an orchestrator. If the requires_human_approval flag is true or the confidence_score is below 0.85, route the plan to an on-call engineer for review instead of executing it automatically.
Prompt Variables
Required inputs for the Data Pipeline Checkpoint Recovery Prompt. Each variable must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of incorrect restart points.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CHECKPOINT_METADATA] | Last successful checkpoint state including offsets, watermarks, and sequence numbers | {"checkpoint_id":"ckpt-2024-01-15T14:30:00Z","offsets":{"topic-orders":{"partition-0":54321,"partition-1":54322}},"watermark":"2024-01-15T14:29:55Z"} | Must be valid JSON. Check that checkpoint_id is non-empty and offsets contain at least one partition mapping. Reject if timestamp is in the future. |
[FAILURE_ERROR] | The exact error message, stack trace, or exception that caused the pipeline to fail | org.apache.kafka.common.errors.RecordDeserializationException: Error deserializing key/value for partition topic-orders-1 at offset 54323. Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)) | Must be a non-empty string. If the error is truncated, flag with a warning. Harness should attach the raw error without modification; do not summarize before passing. |
[PIPELINE_DAG] | The directed acyclic graph definition showing upstream sources, transforms, and downstream sinks | {"nodes":["kafka-source-orders","validate-schema","enrich-customer","sink-warehouse"],"edges":[{"from":"kafka-source-orders","to":"validate-schema"},{"from":"validate-schema","to":"enrich-customer"},{"from":"enrich-customer","to":"sink-warehouse"}]} | Must be valid JSON with nodes and edges arrays. Each edge must reference existing node names. Reject if DAG contains cycles or orphan nodes. |
[SEMANTICS_MODE] | The processing guarantee required: exactly-once, at-least-once, or at-most-once | exactly-once | Must be one of: exactly-once, at-least-once, at-most-once. If exactly-once, the prompt must include a warning section if reprocessing would violate this guarantee. |
[RETRY_BUDGET_REMAINING] | Number of retry attempts remaining before escalation is required | 2 | Must be a non-negative integer. If 0, the prompt should recommend escalation rather than another retry. Harness should decrement this value before each retry. |
[DOWNSTREAM_DEPENDENTS] | List of downstream systems, models, or reports that depend on this pipeline's output | ["daily-revenue-dashboard","ml-fraud-model-training","finance-settlement-batch"] | Must be a JSON array of strings. If empty, flag that impact assessment may be incomplete. Each dependent should match a known system identifier in the data catalog. |
[LOG_TAIL_LINES] | Last N lines of pipeline logs for context around the failure point | 2024-01-15T14:30:01Z INFO checkpoint-committer: Committed checkpoint ckpt-2024-01-15T14:30:00Z 2024-01-15T14:30:02Z ERROR kafka-consumer: Deserialization failed for topic-orders partition-1 offset 54323 2024-01-15T14:30:02Z WARN error-handler: Attempting retry 1 of 3 | Must be a non-empty string. Lines should include timestamps if available. Truncate to last 50 lines if longer. Harness should attach raw log lines without redaction unless PII is present. |
Implementation Harness Notes
How to wire the checkpoint recovery prompt into an automated pipeline restart workflow with validation, retry budgets, and human escalation gates.
The Data Pipeline Checkpoint Recovery Prompt is designed to sit inside an orchestration layer—such as Airflow, Dagster, or Prefect—that catches a pipeline failure, freezes the DAG, and calls the model before any automated restart. The harness should supply three inputs: the checkpoint metadata (last successful offset, watermark, or sequence number), the full error message and stack trace from the failed task, and a serialized representation of the pipeline DAG showing upstream dependencies and state. The model returns a structured JSON payload containing a restart_point, a list of state_repair_instructions, and a boolean exactly_once_violation_risk flag. The harness must parse this output and decide whether to proceed automatically or escalate.
Before executing any restart, the harness must validate the model's output against a strict schema. The restart_point must be a valid node or offset that exists in the provided DAG; if the model hallucinates a task name or offset that isn't present, the harness should reject the output and retry with a clarified error context. The exactly_once_violation_risk flag acts as a circuit breaker: when true, the harness must route the decision to a human operator via a ticketing system or runbook notification, never auto-restarting. For automated paths, implement a retry budget—if the model's recovery suggestion fails more than three times, escalate permanently. Log every recovery attempt with the model's raw output, the validation result, and the execution outcome to build an audit trail for postmortems.
Model choice matters here. Use a model with strong reasoning capabilities and a large context window, as the DAG representation plus error logs can exceed 4K tokens. If the DAG is large, preprocess it to include only the failed task, its direct upstream dependencies, and the checkpoint state—don't send the entire pipeline graph. For streaming pipelines (Kafka, Kinesis), include consumer group offsets and partition assignments. The harness should also implement idempotency guards: before applying any state-repair instruction, check whether the repair was already applied in a prior partial recovery to avoid double-processing. Finally, never let the model directly execute pipeline commands—its output is a recommendation that must pass through validation, human approval gates for high-risk cases, and your existing deployment controls.
Expected Output Contract
Fields, format, and validation rules for the Data Pipeline Checkpoint Recovery Prompt output. Use this contract to parse and validate the model response before passing it to orchestration logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
restart_point | Object | Must contain checkpoint_id (string), offset (string), and timestamp (ISO 8601). Checkpoint_id must match a value from [CHECKPOINT_METADATA]. | |
state_repair_instructions | Array of strings | If present, each element must be a non-empty string. Null or empty array is allowed when no state repair is needed. | |
exactly_once_warning | Boolean | Must be true or false. If true, the harness must block automatic restart and require human approval before proceeding. | |
reprocess_risk | String | Must be one of: none, low, medium, high. If high, the harness must escalate to [ESCALATION_CHANNEL] regardless of exactly_once_warning value. | |
recommended_action | String | Must be one of: restart_from_checkpoint, skip_and_continue, backfill_required, escalate. Harness must route to the corresponding recovery path. | |
confidence_score | Number | Must be a float between 0.0 and 1.0 inclusive. If below [CONFIDENCE_THRESHOLD], the harness must request human review before acting. | |
failure_analysis | Object | Must contain error_class (string matching a known category from [ERROR_CATALOG]) and affected_partitions (array of strings). Affected_partitions must be a subset of partitions listed in [PIPELINE_DAG]. | |
retry_budget_remaining | Number | If present, must be a non-negative integer. Harness must decrement and compare against [MAX_RETRY_BUDGET]. If absent, harness assumes budget is unchanged. |
Common Failure Modes
Checkpoint recovery prompts fail in predictable ways when the model misinterprets state, ignores exactly-once semantics, or produces unsafe restart instructions. These cards cover the most common failure modes and how to guard against them.
Exactly-Once Violation on Restart
What to watch: The model recommends a restart point that would reprocess already-committed records, violating exactly-once semantics. This happens when the prompt doesn't force the model to compare the checkpoint offset against the sink's commit log. Guardrail: Include a required comparison step in the prompt that cross-references the checkpoint watermark with the downstream system's last-committed offset. Add a validator that rejects any restart point earlier than the sink's high-water mark.
State Repair Hallucination
What to watch: The model invents state-repair SQL or configuration changes that don't match the actual pipeline DAG or storage system. This occurs when the prompt provides error context but not the actual state schema or infrastructure details. Guardrail: Require the model to quote the specific DAG node and state table it's referencing before proposing any repair. Add a dry-run validation step that checks proposed repairs against the actual schema before execution.
Checkpoint Metadata Misinterpretation
What to watch: The model misreads the checkpoint format (e.g., treating a Kafka offset as a file line number) or confuses the checkpoint's timestamp with the event time, leading to incorrect restart positioning. Guardrail: Include explicit field definitions for the checkpoint metadata in the prompt. Add a pre-validation step that parses the checkpoint fields and confirms the model's interpretation before accepting the restart recommendation.
Silent Data Loss from Skip Recommendations
What to watch: The model suggests skipping a batch or range of records to unblock the pipeline without flagging the data loss. This is common when the error message mentions a corrupt batch and the model defaults to "skip and continue" without assessing impact. Guardrail: Require the prompt to produce a data-loss impact statement whenever a skip is recommended, including the count of skipped records, the affected time range, and a flag for whether any downstream SCD or aggregate tables would be affected.
Downstream Dependency Blindness
What to watch: The model recommends a restart point that works for the failed node but breaks downstream consumers that depend on the output of the restarted window. The prompt focuses on the failing component without considering the full DAG. Guardrail: Include the downstream dependency graph in the prompt context and require the model to list every downstream consumer that would need re-triggering or validation after the restart. Add a dependency-check step before finalizing the restart plan.
Infinite Retry Loop on Non-Recoverable Errors
What to watch: The model keeps suggesting retries with minor parameter tweaks for errors that are fundamentally non-recoverable (e.g., schema incompatibility, authentication failure, permanently corrupted source data). This wastes compute and delays escalation. Guardrail: Include a retry budget counter in the prompt context and an explicit instruction to classify the error as recoverable or non-recoverable before proposing a restart. If the retry count exceeds the budget, force an escalation recommendation instead of another retry.
Evaluation Rubric
Criteria for testing the checkpoint recovery prompt before deploying it into an automated pipeline restart harness. Each criterion targets a specific failure mode common in state-repair and exactly-once-semantic decisions.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Checkpoint Identification | Output correctly identifies the last committed offset or watermark from [CHECKPOINT_METADATA] and the failure timestamp from [ERROR_LOG] | Output references an offset that does not exist in the provided metadata or suggests a point after the failure | Parse the output restart_point field and assert it matches the expected offset from a labeled golden checkpoint |
Exactly-Once Warning | Output includes a boolean flag or explicit warning when reprocessing from the suggested point would risk duplicate writes | Output omits the exactly-once warning when the pipeline DAG contains non-idempotent sinks or the checkpoint predates a commit boundary | Provide a DAG with a non-idempotent sink and a checkpoint before the last commit; assert exactly_once_risk is true |
State-Repair Instructions | Output provides concrete, ordered steps to repair any corrupted state (e.g., temp files, partial writes) before restart | Output suggests restarting without addressing the state corruption described in [ERROR_LOG] or gives generic advice | Inject a partial-write error into [ERROR_LOG]; assert state_repair_steps is non-empty and references the specific file or table |
Restart Point Safety | Output selects a restart point that is at or before the failure, never after it, and explains the selection rationale | Output suggests skipping the failed record or advancing past it without a clear idempotency guarantee | Provide a failure on record offset 105; assert restart_point <= 105 and rationale field is populated |
Downstream Impact Flag | Output includes a downstream_impact array listing any dependent pipelines, materialized views, or consumers that may need validation | Output focuses only on the failed pipeline and ignores the provided [PIPELINE_DAG] dependencies | Provide a DAG with two downstream consumers; assert downstream_impact contains at least two entries with pipeline names |
Ambiguity Handling | Output explicitly flags when the checkpoint metadata or error log is insufficient to determine a safe restart point and requests human input | Output confidently selects a restart point when the evidence is ambiguous or contradictory | Provide corrupted checkpoint metadata with a gap; assert confidence_score < 0.7 and escalation_required is true |
Output Schema Compliance | Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed | Output is missing required fields, contains extra fields not in the schema, or uses incorrect types | Validate output against the JSON Schema definition; assert no validation errors and all required fields are present |
Retry Budget Awareness | Output respects the [RETRY_BUDGET] parameter and includes a retry_attempt counter; recommends escalation when budget is exhausted | Output suggests another retry when retry_attempt equals or exceeds retry_budget without an escalation recommendation | Set retry_budget to 3 and retry_attempt to 3; assert escalation_required is true and the output does not suggest another automated retry |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with lighter validation. Focus on getting a correct restart point and state-repair instructions without strict schema enforcement. Accept the model's output as a draft for manual review.
- Remove strict JSON schema requirements; accept structured text.
- Drop the exactly-once warning to a soft note.
- Use a shorter pipeline DAG summary instead of the full graph.
Prompt snippet
codeYou are a data pipeline recovery assistant. Given the checkpoint metadata, failure error, and a summary of the pipeline DAG, return a safe restart point and any state-repair instructions. Checkpoint: [CHECKPOINT_METADATA] Error: [FAILURE_ERROR] DAG Summary: [PIPELINE_DAG_SUMMARY] Return: - Restart point - State-repair instructions - Optional: warning if reprocessing might duplicate data
Watch for
- Missing schema checks leading to inconsistent output formats
- Overly broad instructions that produce vague restart points
- No handling of partial commits or in-flight transactions

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us