Inferensys

Prompt

Interrupted Multi-Step Task Resume Prompt

A practical prompt playbook for using the Interrupted Multi-Step Task Resume Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job, ideal user, and constraints for the Interrupted Multi-Step Task Resume Prompt.

This prompt is for AI engineers and product teams building copilots or agents that execute sequential, multi-step workflows—such as onboarding checklists, deployment runbooks, or data processing pipelines—where a user interjects with a correction, question, or new instruction mid-execution. The core job-to-be-done is to safely pause the workflow, produce a structured checkpoint of what has been completed and what is now in doubt, and generate a resume plan that avoids re-executing finished work or violating new constraints introduced by the interruption. It is not a general conversation-repair prompt; it assumes a known, ordered task graph exists and that the primary risk is state corruption from the interruption, not ambiguity about the task itself.

Use this prompt when your system has a defined sequence of steps with dependencies, and an interruption may invalidate some completed or in-progress work. The ideal user is a developer integrating this into an agent harness where the task plan is represented as a list of steps with statuses (e.g., pending, in_progress, completed, blocked). Required context includes the original task plan, the execution log up to the interruption point, and the user's interjection text. Do not use this prompt for open-ended conversations, single-turn corrections, or workflows where steps are independent and can be safely retried without coordination. It is also inappropriate when the interruption is a full task cancellation—this prompt assumes the user wants to resume, not abort.

Before wiring this into production, define the schema for your task plan and execution log. The prompt expects structured input, not freeform history. You must also implement a post-generation validator that checks the resume plan for step duplication, missing dependencies, and ordering violations. For high-stakes workflows—such as financial operations or infrastructure changes—require human approval of the checkpoint summary before the agent resumes execution. The next section provides the copy-ready prompt template you can adapt to your task schema and interruption-handling logic.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Interrupted Multi-Step Task Resume Prompt works, where it fails, and the operational prerequisites for safe deployment.

01

Good Fit: Sequential Workflows with Idempotent Steps

Use when: The task decomposes into discrete, ordered steps where re-executing a completed step is safe or explicitly detectable. Guardrail: Design step definitions to be idempotent or include a completion marker in the checkpoint to prevent duplicate side effects.

02

Bad Fit: Real-Time Physical Control Systems

Avoid when: The task involves sub-second latency requirements or continuous physical actuation where a pause-to-resume cycle is unsafe. Guardrail: Do not use this prompt for robotics, vehicle control, or medical device actuation. Human-in-the-loop approval is mandatory for any physical action.

03

Required Input: Structured Task Graph

Risk: Without a predefined task graph or step schema, the model cannot reliably determine what 'completed' means. Guardrail: Provide a machine-readable list of steps with IDs, dependencies, and completion criteria as part of the prompt context. Do not rely on the model to infer the workflow from natural language alone.

04

Required Input: Immutable Execution Log

Risk: If the model hallucinates which steps were completed, the resume plan will either skip necessary work or repeat destructive actions. Guardrail: Pass a structured, append-only execution log generated by the application runtime. The prompt should summarize, not invent, the execution history.

05

Operational Risk: Dependency Violation on Resume

Risk: The interruption may invalidate a dependency that a previously completed step relied on, creating a hidden inconsistency. Guardrail: The resume plan must include a dependency re-validation pass for all completed steps whose upstream inputs could have been altered by the interruption.

06

Operational Risk: Silent Context Loss

Risk: Critical context from before the interruption is truncated or summarized away, causing the resume plan to miss a constraint. Guardrail: Implement a context budget check before generating the resume plan. If the pre-interruption context exceeds the window, force a clarification request to the user instead of guessing.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template with square-bracket placeholders for resuming multi-step tasks after user interruption.

This prompt template is designed for copilots and agents executing sequential workflows that get interrupted by user interjection. It instructs the model to produce a structured checkpoint of completed steps, pending dependencies, and the interruption's impact, then generate a resume plan that avoids re-executing completed work. The template uses square-bracket placeholders that you replace with your application's specific task definitions, conversation history, and output schema requirements before sending to the model.

code
You are a task-resume assistant for a multi-step workflow system. Your job is to analyze an interrupted task, produce a checkpoint of what was completed, and generate a safe resume plan.

# TASK DEFINITION
[TASK_STEPS]

# CONVERSATION HISTORY
[CONVERSATION_HISTORY]

# INTERRUPTION DETAILS
Interruption type: [INTERRUPTION_TYPE]
User's interjection: [USER_INTERJECTION]
Step being executed when interrupted: [INTERRUPTED_STEP_ID]

# OUTPUT SCHEMA
Return a JSON object with this exact structure:
{
  "checkpoint": {
    "completed_steps": [
      {
        "step_id": "string",
        "step_description": "string",
        "output_summary": "string",
        "validation_status": "valid|needs_review|invalidated_by_interruption"
      }
    ],
    "in_progress_step": {
      "step_id": "string | null",
      "partial_output": "string | null",
      "recovery_notes": "string"
    },
    "pending_steps": [
      {
        "step_id": "string",
        "step_description": "string",
        "depends_on": ["step_id"]
      }
    ],
    "interruption_impact": {
      "invalidated_steps": ["step_id"],
      "context_changes": ["string"],
      "new_constraints": ["string"]
    }
  },
  "resume_plan": {
    "restart_from_step": "string",
    "steps_to_skip": ["step_id"],
    "steps_to_repeat": ["step_id"],
    "revised_step_sequence": ["step_id"],
    "rationale": "string"
  },
  "requires_user_confirmation": true,
  "confirmation_question": "string | null"
}

# CONSTRAINTS
- Do not re-execute steps marked as completed and valid unless explicitly invalidated by the interruption.
- If the interruption changes a dependency, mark dependent steps for re-execution.
- If the interruption introduces ambiguity about prior outputs, flag those steps as needs_review.
- If the interruption is a correction to a prior step, treat that step and all dependents as invalidated.
- If the interruption is a new request unrelated to the current task, propose completing the current task first unless the user explicitly demands priority change.
- Set requires_user_confirmation to true if the resume plan changes the task outcome, skips user-visible steps, or re-executes work the user may have already seen.
- If the interruption intent is unclear, set requires_user_confirmation to true and ask a specific clarification question.

# EXAMPLES
[FEW_SHOT_EXAMPLES]

# RISK LEVEL
[RISK_LEVEL]

Analyze the interruption and produce the checkpoint and resume plan.

To adapt this template, replace the square-bracket placeholders with your application data. [TASK_STEPS] should contain the ordered list of steps with their IDs, descriptions, and dependency relationships. [CONVERSATION_HISTORY] should include the full turn history up to the interruption point. [INTERRUPTION_TYPE] classifies the interruption as a correction, new request, clarification, or unrelated input. [FEW_SHOT_EXAMPLES] should include 2-3 examples of interrupted workflows with correct checkpoint and resume plan outputs, covering at least one correction scenario and one new-request scenario. For high-risk workflows where incorrect step ordering could cause data loss, financial impact, or safety issues, set [RISK_LEVEL] to "high" and ensure your application layer enforces human approval before executing the resume plan. Always validate the output JSON against your schema before acting on the resume plan, and log both the checkpoint and the final executed plan for auditability.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Interrupted Multi-Step Task Resume Prompt. Each placeholder must be populated before the prompt is assembled and sent. Missing or malformed variables are the most common cause of incorrect step reordering and duplicated work.

PlaceholderPurposeExampleValidation Notes

[TASK_DEFINITION]

The original multi-step task description, including the ordered list of steps the agent was executing before the interruption.

  1. Fetch Q3 sales data from Snowflake. 2. Calculate MoM growth by region. 3. Generate a summary table. 4. Draft an email to the VP of Sales.

Must contain a numbered or bulleted sequence. Parse to extract step count. If fewer than 2 steps, reject: this prompt requires a multi-step workflow.

[COMPLETED_STEPS_LOG]

A structured log of steps that were fully completed before the interruption, including any outputs or artifacts produced.

Step 1: COMPLETED. Output: q3_sales_raw.csv (1200 rows). Step 2: COMPLETED. Output: mom_growth_by_region.json.

Each entry must have a step identifier matching [TASK_DEFINITION] and a status of COMPLETED. Validate that no step is marked COMPLETED if its dependencies are not also COMPLETED.

[IN_PROGRESS_STEP]

The step that was actively executing when the interruption occurred, including any partial output or intermediate state.

Step 3: IN_PROGRESS. Partial output: summary_table_draft.md with 2 of 4 regions populated.

Must reference exactly one step from [TASK_DEFINITION]. If null, the interruption occurred between steps. Validate that the step identifier exists in the task definition.

[INTERRUPTION_EVENT]

A description of what the user said or did that caused the interruption, quoted verbatim when possible.

User: 'Wait, exclude the EMEA region from the growth calculation and redo it.'

Must be non-empty. If the interruption is a system event rather than user input, describe it explicitly (e.g., 'Connection timeout after 30s'). Do not paraphrase user intent here; that is the model's job.

[DEPENDENCY_GRAPH]

A map of which steps depend on the outputs of which other steps, used to prevent re-execution of still-valid work.

{step_3: [step_2], step_4: [step_3]}

Must be a valid JSON object. Keys and values must reference step identifiers from [TASK_DEFINITION]. If no dependencies exist, pass an empty object. Validate that no circular dependencies are present.

[STATE_SNAPSHOT]

A serialized snapshot of the agent's full state at the moment of interruption, including variable bindings, tool call history, and open transactions.

{'region_filter': ['NA', 'APAC', 'LATAM'], 'last_tool_call': 'run_sql_query', 'transaction_id': 'txn_9042'}

Must be valid JSON. Include all mutable state that could affect step re-execution. If the agent is stateless between steps, pass an empty object. Validate that referenced tool call IDs exist in the execution log.

[RESUME_CONSTRAINTS]

Any new constraints, policies, or user preferences introduced by the interruption that must be applied to the resumed execution.

Exclude EMEA region from all subsequent calculations. Do not re-fetch data from Snowflake; reuse q3_sales_raw.csv.

Must be a list of explicit, actionable constraints. Avoid vague instructions like 'be more careful.' Each constraint should be testable: can a validator check whether the resumed plan violates it?

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the interrupted multi-step task resume prompt into a production agent or copilot application.

This prompt is designed to be called as a recovery subroutine within an agent execution loop, not as a standalone chat turn. When the main agent loop detects a user interjection—either through an explicit interruption signal in a real-time interface or by classifying an incoming user message as a correction or new instruction—the loop should pause the current task, capture the execution state, and invoke this prompt. The prompt expects a structured snapshot of the original plan, completed steps with their outputs, pending steps, and the user's interjection text. Its output is a machine-readable resume plan that the agent executor can consume directly.

Wire the prompt into your agent harness with a strict JSON schema for both input and output. The input should include: [ORIGINAL_PLAN] as an ordered list of step objects with id, description, and status; [COMPLETED_STEPS] as a list of step objects with id, output_summary, and artifacts; [PENDING_STEPS] as the remaining ordered list; and [USER_INTERJECTION] as the raw text. The output schema must enforce resume_plan (ordered list of steps to execute, with step_id, action, and reuse_completed_output boolean), invalidated_steps (list of completed step IDs that must be re-executed), and interruption_impact_summary (string). Validate the output before passing it to the agent executor: confirm no completed step appears in the resume plan unless explicitly invalidated, verify step ordering preserves declared dependencies, and reject plans that re-execute work without justification.

For model choice, use a model with strong instruction-following and JSON mode support—GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are appropriate. Set temperature=0 to maximize deterministic step ordering. Implement a retry loop: if the output fails schema validation, re-invoke the prompt with the validation error appended to the [CONSTRAINTS] field, up to two retries. After two failures, escalate to a human operator with the original plan, completed steps, and interjection for manual resumption. Log every invocation with the input plan, interjection text, raw output, validation result, and final resume plan for debugging and audit. This prompt is high-risk in production because incorrect step ordering can duplicate work, skip critical actions, or violate task dependencies—always run the eval suite described in the testing section before deploying changes to the prompt or the surrounding harness.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required structure, types, and validation rules for the resume plan object. Use this contract to parse and validate the model's output before executing any resumed steps.

Field or ElementType or FormatRequiredValidation Rule

checkpoint_summary

Array of objects

Must contain at least one object. Each object must have 'step_id' (string) and 'status' (enum: completed, in_progress, pending).

checkpoint_summary[].step_id

String

Must match a step identifier from the [ORIGINAL_PLAN] input. No duplicate step_ids allowed in the array.

checkpoint_summary[].status

Enum string

Must be one of: completed, in_progress, pending. 'completed' steps must not appear in the resume_execution_plan.

interruption_impact

Object

Must contain 'invalidated_steps' (array of strings) and 'context_changes' (array of strings). Both arrays can be empty but must be present.

interruption_impact.invalidated_steps

Array of strings

Each string must be a step_id from [ORIGINAL_PLAN]. Steps listed here must be re-executed or replaced in the resume plan.

resume_execution_plan

Array of objects

Must be an ordered array. Each object requires 'step_id' (string), 'action' (enum), and 'dependency' (array of strings or null).

resume_execution_plan[].action

Enum string

Must be one of: execute, skip, confirm_with_user. 'skip' is only valid if the step is listed as 'completed' in checkpoint_summary.

resume_execution_plan[].dependency

Array of strings or null

If not null, every step_id listed must appear earlier in the resume_execution_plan array. Circular dependencies must be absent. Use null for no dependencies.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when resuming interrupted multi-step tasks and how to guard against it.

01

Step Re-Execution After Resume

What to watch: The model re-runs completed steps because it fails to distinguish finished work from pending work in the checkpoint summary. This wastes resources and can produce duplicate side effects. Guardrail: Require the checkpoint to include explicit completed_steps and pending_steps arrays with unique step IDs. Validate that the resume plan references only pending step IDs before execution.

02

Dependency Violation on Restart

What to watch: The resume plan reorders steps so a dependent step executes before its prerequisite, either because the interruption invalidated a prior result or the model lost track of the dependency graph. Guardrail: Include a dependency_map in the checkpoint. Before executing the resume plan, run a validator that checks each step's prerequisites exist in the completed_steps list or appear earlier in the revised plan.

03

Interruption Impact Scope Creep

What to watch: The model overcorrects by discarding valid completed work that the interruption did not actually affect, treating a narrow user correction as a full workflow reset. Guardrail: Require the prompt to produce an impact_assessment that explicitly lists which completed steps remain valid and which are invalidated. Diff the pre- and post-interruption state and flag any discarded step not mentioned in the impact assessment for human review.

04

Context Starvation on Resume

What to watch: The resume prompt receives a truncated or stale checkpoint because the serialized state was too large, pruned incorrectly, or lost during the interruption. The model fills gaps with hallucinated state. Guardrail: Design the checkpoint schema with a context_checksum or hash of critical state fields. On resume, verify the checksum matches and require the model to output NEEDS_RECONSTRUCTION for any field it cannot ground in the provided checkpoint before proceeding.

05

User Intent Drift After Interruption

What to watch: The user's interrupting message changes the overall goal, but the resume prompt treats it as a minor clarification and continues the original workflow with only superficial adjustments. Guardrail: Include an explicit intent_comparison step in the prompt: classify the original intent, classify the interrupting intent, and output a goal_changed boolean. If true, require explicit user confirmation before resuming any prior steps.

06

Idempotency Failure on Side-Effect Steps

What to watch: Completed steps with external side effects—API calls, database writes, message sends—are re-executed because the resume plan cannot safely verify they already succeeded. Guardrail: Require each step in the checkpoint to include an idempotency_key and side_effect_status. Before re-executing any step marked as having side effects, the system must check the external system for the idempotency key, not rely on the model's memory.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Interrupted Multi-Step Task Resume Prompt before shipping. Each criterion targets a specific failure mode in checkpoint generation, step ordering, and dependency handling. Run these checks against a golden dataset of interrupted workflow traces.

CriterionPass StandardFailure SignalTest Method

Checkpoint Completeness

All completed steps from the pre-interruption trace appear in the checkpoint summary with correct status

Missing a completed step or mislabeling a completed step as pending

Diff the checkpoint step list against the ground-truth completed steps from the trace

Pending Dependency Accuracy

All pending steps list their correct unmet dependencies and no false dependencies are introduced

A pending step omits a required dependency or lists a dependency already satisfied by a completed step

Parse the dependency graph from the output and validate against the ground-truth workflow DAG

Interruption Impact Classification

The interruption's impact is classified correctly as one of: invalidates prior steps, modifies pending steps, or adds new steps

Impact classification contradicts the ground-truth label or is missing entirely

Compare the output classification label to the annotated ground-truth impact type

Resume Plan Step Ordering

The resume plan executes steps in a valid topological order respecting all dependencies

A step appears before its dependencies are satisfied or a completed step is scheduled for re-execution

Topological sort validation of the resume plan against the declared dependency graph

No Duplicate Execution

The resume plan does not include any step already marked as completed in the checkpoint

A completed step appears in the resume plan action list

Set intersection check between completed step IDs and resume plan step IDs

Context Reconciliation

The output explicitly flags which prior context assumptions are invalidated by the interruption

No stale context flags present when the interruption changed relevant facts or slot values

Check for a non-empty stale context list when the interruption trace includes a fact change

Human Approval Trigger

The output requests human approval when the interruption affects a step marked as high-risk or irreversible

High-risk step is rescheduled without an approval flag or the approval field is missing

Verify the approval field is true when the interrupted step matches the high-risk registry

Serialization Validity

The output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed

JSON parse error, missing required field, or type mismatch in any field

Schema validation against the declared output contract with strict type checking

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON schema for the checkpoint and resume plan. Use a single model call without retries. Hardcode the workflow steps as a numbered list in [WORKFLOW_STEPS] so the model has a clear reference for what 'completed' means.

code
[WORKFLOW_STEPS]
1. Fetch account details
2. Verify identity
3. Check transaction history
4. Generate report

Watch for

  • The model reordering steps that have strict dependencies
  • Missing 'interruption_impact' field when the interjection is ambiguous
  • Resume plans that skip verification steps because they look similar to completed ones
Prasad Kumkar

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.