Skip to main content

Summary

Execute a compiled batch of plan-safe operation entries with per-entry transactions, capture resolution between entries, and keep-prefix-and-continue failure semantics.
  • Operation ID: plan.execute
  • API member path: editor.doc.plan.execute(...)
  • Mutates document: yes
  • Idempotency: non-idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a PlanExecuteResult with per-entry receipts, projected captures, and the first hard failure if any.

Input fields

FieldTypeRequiredDescription
captureReturns"*" | string[]noOne of: "*", string[]
entriesobject[]yes

Example request

{
  "captureReturns": "*",
  "entries": [
    {
      "input": {},
      "operationId": "example",
      "options": {}
    }
  ]
}

Output fields

FieldTypeRequiredDescription
capturesobjectyes
failureobjectno
failure.entryIndexintegerno
failure.messagestringno
failure.operationIdstringno
receiptsobject[]yes

Example response

{
  "captures": {},
  "failure": {
    "entryIndex": 1,
    "message": "Operation failed.",
    "operationId": "example"
  },
  "receipts": [
    {
      "captureAs": "example",
      "entryIndex": 1,
      "error": "example",
      "operationId": "example",
      "status": "passed"
    }
  ]
}

Pre-apply throws

  • INVALID_INPUT
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "captureReturns": {
      "oneOf": [
        {
          "const": "*"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      ]
    },
    "entries": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "captureAs": {
            "type": "string"
          },
          "expect": {
            "additionalProperties": false,
            "properties": {
              "allowFailureMessageIncludes": {
                "type": "string"
              },
              "failureCode": {
                "type": "string"
              },
              "failureMessageIncludes": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "input": {},
          "operationId": {
            "type": "string"
          },
          "options": {}
        },
        "required": [
          "operationId"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "entries"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "captures": {
      "type": "object"
    },
    "failure": {
      "additionalProperties": false,
      "properties": {
        "entryIndex": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "operationId": {
          "type": "string"
        }
      },
      "required": [
        "entryIndex",
        "operationId",
        "message"
      ],
      "type": "object"
    },
    "receipts": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "captureAs": {
            "type": [
              "string",
              "null"
            ]
          },
          "entryIndex": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "operationId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "passed",
              "allowed-failure",
              "expected-failure"
            ]
          }
        },
        "required": [
          "entryIndex",
          "operationId",
          "status",
          "captureAs"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "receipts",
    "captures"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "captures": {
      "type": "object"
    },
    "failure": {
      "additionalProperties": false,
      "properties": {
        "entryIndex": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "operationId": {
          "type": "string"
        }
      },
      "required": [
        "entryIndex",
        "operationId",
        "message"
      ],
      "type": "object"
    },
    "receipts": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "captureAs": {
            "type": [
              "string",
              "null"
            ]
          },
          "entryIndex": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "operationId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "passed",
              "allowed-failure",
              "expected-failure"
            ]
          }
        },
        "required": [
          "entryIndex",
          "operationId",
          "status",
          "captureAs"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "receipts",
    "captures"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "INVALID_INPUT",
            "CAPABILITY_UNAVAILABLE"
          ]
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}