---
title: "monitor_and_replan"
description: "Detect world changes that invalidate the current plan and trigger replanning when needed."
canonical: "https://acs.synapti.ai/workflows/monitor-and-replan/"
last_updated: "2026-11-16T03:28:14Z"
---

# Detect world changes that invalidate the current plan and trigger replanning when needed.

Generated from [schemas/workflow_catalog.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/workflow_catalog.yaml) at commit 18c38b74ac21.

- Workflow id: `monitor_and_replan`
- Risk: medium
- Catalog: reference workflows
- Declares Standard 1.1.0
- Steps: 7

This workflow pattern continuously monitors world state against plan assumptions
and triggers replanning when significant divergence is detected. It's designed
to be invoked periodically during plan execution or when external events suggest
the world may have changed.

**Figure: Steps of monitor_and_replan: 7 steps.** Read top to bottom: no step changes state; steps 3, 4, 5 and 6 have gates; steps 1 and 6 say what to do on failure; and the highest step risk is low, at steps 1, 2, 3, 4, 5, 6 and 7.

| # | Capability | Layer | Role | Gates | On failure | Reads from | Risk |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | `observe` | PERCEIVE |  |  | request_more_context |  | low |
| 2 | `state` | MODEL |  |  |  | 1 | low |
| 3 | `compare` | UNDERSTAND |  | skip |  | 2 | low |
| 4 | `detect` | UNDERSTAND |  | skip |  | 3 | low |
| 5 | `critique` | REASON |  | skip |  | 4 | low |
| 6 | `plan` | REASON |  | skip | stop | 4, 5 | low |
| 7 | `audit` | VERIFY |  |  |  | 4, 6 | low |

## Inputs

**Figure: Inputs of monitor_and_replan.** 1 input, 1 required (filled pin) and 0 optional (outlined pin), with 4 named fields inside them.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | object | Yes |  |
| `plan.id` | string | No |  |
| `plan.goal` | string | No |  |
| `plan.scope` | string | No |  |
| `plan.assumed_state` | object | No |  |

## Steps

1. [`observe`](https://acs.synapti.ai/capabilities/observe/index.md): Capture current world state for comparison. Stores `current_state_out`. (risk low)
2. [`state`](https://acs.synapti.ai/capabilities/state/index.md): Create structured state representation. Stores `world_state_out`. (risk low)
3. [`compare`](https://acs.synapti.ai/capabilities/compare/index.md): Compare current state against plan assumptions. Stores `comparison_out`. (risk low)
   - Gate: when `${plan.assumed_state} == null`, skip: The plan records no assumed state to compare against.
4. [`detect`](https://acs.synapti.ai/capabilities/detect/index.md): Detect assumption violations that affect plan validity. Stores `violations_out`. (risk low)
   - Gate: when `${plan.assumed_state} == null`, skip: The plan records no assumed state, so no assumption can be violated; the plan remains valid.
5. [`critique`](https://acs.synapti.ai/capabilities/critique/index.md): Assess impact of violations on current plan. Stores `critique_out`. (risk low)
   - Gate: when `${violations_out} == null || ${violations_out.detected} == false`, skip: No assumption violation detected; the plan remains valid.
6. [`plan`](https://acs.synapti.ai/capabilities/plan/index.md): Generate revised plan incorporating new constraints. Stores `revised_plan_out`. (risk low)
   - Gate: when `${critique_out} == null || ${critique_out.issues} == []`, skip: No violation of high severity or worse; keep the current plan.
7. [`audit`](https://acs.synapti.ai/capabilities/audit/index.md): Record assumption check and any replanning decision. Stores `audit_out`. (risk low)

## Data flow

**Figure: Which step reads which stored output.** 6 steps read the output of earlier steps, 8 reads in all; step 6 (plan) reads the most, from 2 steps.

- Step 2 reads from step 1.
- Step 3 reads from step 2.
- Step 4 reads from step 3.
- Step 5 reads from step 4.
- Step 6 reads from steps 4 and 5.
- Step 7 reads from steps 4 and 6.

## Risk

**Figure: Risk of monitor_and_replan: declared medium; highest step risk low, at step 1 (observe).** The catalog declares medium; the highest step risk is low.

- Step 1 (`observe`): low
- Step 2 (`state`): low
- Step 3 (`compare`): low
- Step 4 (`detect`): low
- Step 5 (`critique`): low
- Step 6 (`plan`): low
- Step 7 (`audit`): low

## Success criteria

- Plan assumptions validated OR violations detected
- If violations detected, revised plan generated
- Audit trail of assumption checks maintained

## Validate it

```sh
python tools/validate_workflows.py --catalog schemas/workflow_catalog.yaml
```

## Workflow YAML

```yaml
monitor_and_replan:
  goal: Detect world changes that invalidate the current plan and trigger replanning when needed.
  risk: medium
  description: |
    This workflow pattern continuously monitors world state against plan assumptions
    and triggers replanning when significant divergence is detected. It's designed
    to be invoked periodically during plan execution or when external events suggest
    the world may have changed.
  success:
  - Plan assumptions validated OR violations detected
  - If violations detected, revised plan generated
  - Audit trail of assumption checks maintained
  steps:
  - capability: observe
    purpose: Capture current world state for comparison.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: current_state_out
    input_bindings:
      target: "${plan.scope}"
    failure_modes:
    - condition: Unable to observe relevant state
      on_error: [R401, R402]
      action: request_more_context
      recovery: Request specific state aspects to monitor.
  - capability: state
    purpose: Create structured state representation.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: world_state_out
    input_bindings:
      scope: ${plan.scope}
      observations: ${current_state_out.observation}
    failure_modes: []
  - capability: compare
    purpose: Compare current state against plan assumptions.
    domain: assumption_validation
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: comparison_out
    input_bindings:
      options:
      - ${world_state_out.state}
      - ${plan.assumed_state}
      criteria:
      - assumption_validity
      - state_divergence
    gates:
    - when: ${plan.assumed_state} == null
      action: skip
      message: The plan records no assumed state to compare against.
    failure_modes: []
  - capability: detect
    purpose: Detect assumption violations that affect plan validity.
    domain: plan_invalidation
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: violations_out
    input_bindings:
      data: ${comparison_out}
      pattern: assumption_violation
    gates:
    - when: ${plan.assumed_state} == null
      action: skip
      message: The plan records no assumed state, so no assumption can be violated; the plan remains valid.
    failure_modes: []
  - capability: critique
    purpose: Assess impact of violations on current plan.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: critique_out
    input_bindings:
      target:
        plan: ${plan}
        violations: "${violations_out.matches: array<object>}"
      criteria:
      - step_validity
      - goal_achievability
      - resource_availability
      severity_threshold: high
    gates:
    - when: ${violations_out} == null || ${violations_out.detected} == false
      action: skip
      message: No assumption violation detected; the plan remains valid.
    failure_modes: []
  - capability: plan
    purpose: Generate revised plan incorporating new constraints.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: revised_plan_out
    input_bindings:
      goal: ${plan.goal}
      constraints:
        violations: "${violations_out.matches: array<object>}"
        suggestions: "${critique_out.suggestions: array<object>}"
    gates:
    - when: ${critique_out} == null || ${critique_out.issues} == []
      action: skip
      message: No violation of high severity or worse; keep the current plan.
    failure_modes:
    - condition: Unable to find viable plan
      when: ${revised_plan_out.steps} == []
      on_error: R402
      action: stop
      recovery: Escalate to human with violation details.
  - capability: audit
    purpose: Record assumption check and any replanning decision.
    risk: low
    mutation: false
    requires_checkpoint: false
    requires_approval: false
    timeout: null
    retry: null
    store_as: audit_out
    input_bindings:
      event:
        type: assumption_check
        original_plan: ${plan.id}
        violations: ${violations_out.detected}
        revised_plan: "${revised_plan_out.steps: array<object>}"
    failure_modes: []
  inputs:
    plan:
      type: object
      required: true
      properties:
        id: {type: string}
        goal: {type: string}
        scope: {type: string}
        assumed_state: {type: object}
```
