---
title: "Objective error event"
method: POST
path: "objective_event.error"
---

# Objective error event

`POST objective_event.error` (webhook)

Triggered when an error occurs during objective execution

## Payload

- ObjectiveEventWebhookData — The envelope for an objective event webhook delivery. Contains timestamp, event type, and the webhook data payload.
  - `type` string, required — The event type, prefixed with objective_event. (e.g., objective_event.tool_result)
  - `timestamp` string, date-time, required
  - `data` object, required — The webhook data payload with flat top-level keys for agent, variation, objective, and event.
    - `agent` ResourceMetadata, required — Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
      - `id` string, required — Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...")
      - `accountId` string, required — Account this resource belongs to for multi-tenant isolation (prefixed ULID)
      - `workspaceId` string, required — Workspace this resource belongs to for organizational grouping (prefixed ULID)
      - `name` string, required — Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly
      - `externalId` string — External ID for the resource (e.g., a workflow ID from an external system)
      - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"}
      - `profileId` string, required — ID of the actor (user or service account) that created this resource
      - `createdAt` string, date-time, required — Timestamp when this resource was created
      - `bundleKey` string — Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
      - `updatedAt` string, date-time — Timestamp when this resource was last updated
    - `agentVariation` ResourceMetadata, required — Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
      - `id` string, required — Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...")
      - `accountId` string, required — Account this resource belongs to for multi-tenant isolation (prefixed ULID)
      - `workspaceId` string, required — Workspace this resource belongs to for organizational grouping (prefixed ULID)
      - `name` string, required — Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly
      - `externalId` string — External ID for the resource (e.g., a workflow ID from an external system)
      - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"}
      - `profileId` string, required — ID of the actor (user or service account) that created this resource
      - `createdAt` string, date-time, required — Timestamp when this resource was created
      - `bundleKey` string — Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
      - `updatedAt` string, date-time — Timestamp when this resource was last updated
    - `objective` OperationMetadata, required — Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
      - `id` string, required — Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...")
      - `accountId` string, required — Account this operation belongs to for multi-tenant isolation (prefixed ULID)
      - `workspaceId` string, required — Workspace this operation belongs to for organizational grouping (prefixed ULID)
      - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"}
      - `createdAt` string, date-time, required — Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying
      - `externalId` string — External ID for the operation (e.g., a workflow ID from an external system)
      - `profileId` string, required — ID of the actor (user or service account) that created this operation
    - `objectiveEvent` ObjectiveEvent, required
      - `metadata` OperationMetadata, required — Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
        - `id` string, required — Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...")
        - `accountId` string, required — Account this operation belongs to for multi-tenant isolation (prefixed ULID)
        - `workspaceId` string, required — Workspace this operation belongs to for organizational grouping (prefixed ULID)
        - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"}
        - `createdAt` string, date-time, required — Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying
        - `externalId` string — External ID for the operation (e.g., a workflow ID from an external system)
        - `profileId` string, required — ID of the actor (user or service account) that created this operation
      - `data` ObjectiveEventData, required
        - `type` string
        - `userMessage` UserMessage
          - `content` string
        - `toolApprovalRequested` ToolApprovalRequested
          - `toolCallId` string — The ID of the objective tool call record. Use this ID with the ApproveToolCall or DenyToolCall RPCs to approve or deny the tool call.
        - `toolApproved` ToolApproved
          - `toolCallId` string — The ID of the objective tool call record that was approved via the ApproveToolCall RPC.
        - `toolDenied` ToolDenied
          - `toolCallId` string — The ID of the objective tool call record that was denied via the DenyToolCall RPC.
          - `memo` string — The memo provided by the reviewer when denying the tool call. This is passed to the agent to provide further instructions.
        - `toolCalled` ToolCalled
          - `toolCallId` string — The ID of the objective tool call record that was executed.
        - `error` ObjectiveError
          - `type` string
          - `message` string
        - `assistantMessage` AssistantMessage
          - `content` string
          - `toolCalls` AssistantToolCall[]
            - `tool` CallableTool — CallableTool is a union that represents a tool that can be called by an agent. In Cadenya, a tool that is used within an agent objective might be a user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context), or a Cadenya Tool (one Cadenya provides).
              - …
            - `arguments` string
            - `functionName` string
        - `toolResult` ToolResult
          - `toolCallId` string, required
          - `result` ObjectiveToolCallResult, required — ObjectiveToolCallResult is the content a tool returned after execution. Tools can return multiple content blocks, and blocks can be multi-modal (text, image, audio). Media blocks are stored by Cadenya and served as short-lived signed URLs rather than inline bytes.
            - `content` ObjectiveToolCallResultContentBlock[], required
              - …
        - `toolError` ToolError
          - `toolCallId` string — The ID of the objective tool call record that encountered an error during execution.
          - `message` string
        - `contextWindowCompacted` ContextWindowCompacted
          - `newContextWindow` ObjectiveContextWindowData
            - `objectiveId` string — The objective's ID that this window belongs to
            - `sequence` integer — sequence is a numeric representation of which context window this is. Sequences are useful to perform a max(sequence) on in order to calculate how many context windows an objective has.
            - `promptTokens` integer — A calculated value for how many prompt tokens (input tokens) have been used in this context window
            - `completionTokens` integer — A calculated value for how many completion tokens (output tokens) have been used in this context window
            - `previousWindowContinueInstructions` string — The instructions for this window to continue from a previous window's chat history.
          - `strategies` string[] — The strategies that were applied during this compaction
          - `messagesCompacted` integer — Number of messages that were compacted
          - `summary` string — The summary generated by the summarization strategy, if used.
        - `memoryRead` MemoryRead — MemoryRead is emitted each time the agent resolves a key against the memory cascade and loads an entry. Lookups that miss (key not found in any layer) do not emit this event.
          - `message` string — Human-readable description of the read, set by the runtime. For example: "Loaded skill", "Resolved context key". Not machine-parsed; intended for UI display alongside the other events in an objective's timeline.
          - `memoryLayerId` string — The layer the entry resolved to. The top-most layer that contained the key — other layers beneath it that also contained the key are shadowed and not referenced here.
          - `memoryEntryId` string — The specific entry that was read.
        - `cancelled` ObjectiveCancelled — ObjectiveCancelled is the terminal event written when an objective is cancelled. After this event, the objective is super-terminal: no further iterations, compaction, or continuation are permitted.
          - `message` string — Optional human-readable note recorded at cancel time. Today the workflow sets "Cancelled" but this field leaves room for richer reasons (e.g. "Cancelled by user", "Cancelled by schedule sweep", "Credit balance exhausted").
        - `subAgentSpawned` SubAgentSpawned
          - `agent` ResourceMetadata — Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
            - `id` string, required — Unique identifier for the resource (prefixed ULID, e.g., "agent_01HXK...")
            - `accountId` string, required — Account this resource belongs to for multi-tenant isolation (prefixed ULID)
            - `workspaceId` string, required — Workspace this resource belongs to for organizational grouping (prefixed ULID)
            - `name` string, required — Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly
            - `externalId` string — External ID for the resource (e.g., a workflow ID from an external system)
            - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"}
            - `profileId` string, required — ID of the actor (user or service account) that created this resource
            - `createdAt` string, date-time, required — Timestamp when this resource was created
            - `bundleKey` string — Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.
            - `updatedAt` string, date-time — Timestamp when this resource was last updated
          - `objective` OperationMetadata — Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
            - `id` string, required — Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...")
            - `accountId` string, required — Account this operation belongs to for multi-tenant isolation (prefixed ULID)
            - `workspaceId` string, required — Workspace this operation belongs to for organizational grouping (prefixed ULID)
            - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"}
            - `createdAt` string, date-time, required — Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying
            - `externalId` string — External ID for the operation (e.g., a workflow ID from an external system)
            - `profileId` string, required — ID of the actor (user or service account) that created this operation
          - `task` string
        - `subAgentUpdated` SubAgentUpdated
          - `agent` BareMetadata — BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.
            - `id` string
            - `name` string — Human-readable name of the referenced resource, populated by the server on reads for convenience. Absent on references to resources that do not have a name (e.g., objective tasks).
          - `objective` BareMetadata — BareMetadata contains the minimal metadata for a resource: the ID and an optional human-readable name. These are used for reference fields where the full metadata (account scoping, timestamps, labels, external IDs) is not needed — e.g., the tool references inside an agent variation spec or the tools assigned to an objective. Both fields are server-populated; clients provide IDs through sibling fields rather than by constructing a BareMetadata themselves.
            - `id` string
            - `name` string — Human-readable name of the referenced resource, populated by the server on reads for convenience. Absent on references to resources that do not have a name (e.g., objective tasks).
          - `status` 'STATUS_UNSPECIFIED' | 'STATUS_PENDING' | 'STATUS_RUNNING' | 'STATUS_COMPLETED' | 'STATUS_FAILED' | 'STATUS_CANCELLED', enum
          - `message` string
        - `finalized` ObjectiveFinalized — ObjectiveFinalized is the terminal event written when an objective is finalized. After this event, the objective is super-terminal: no further iterations, compaction, or continuation are permitted.
          - `output` object — If the objective was created with an output schema, and the agent successfully completed the objective, this field will contain the structured output of the objective.
      - `contextWindowId` string
      - `info` ObjectiveEventInfo
        - `objective` OperationMetadata — Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
          - `id` string, required — Unique identifier for the operation (prefixed ULID, e.g., "obj_01HXK...")
          - `accountId` string, required — Account this operation belongs to for multi-tenant isolation (prefixed ULID)
          - `workspaceId` string, required — Workspace this operation belongs to for organizational grouping (prefixed ULID)
          - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"priority": "high", "source": "api", "workflow": "onboarding"}
          - `createdAt` string, date-time, required — Timestamp when this operation was created ULID includes timestamp information, but this explicit field enables easier querying
          - `externalId` string — External ID for the operation (e.g., a workflow ID from an external system)
          - `profileId` string, required — ID of the actor (user or service account) that created this operation
        - `createdBy` Profile — A profile identifies a user or non-human principal (such as an API key) at the account level. Profiles are account-scoped and can be granted access to multiple workspaces.
          - `metadata` AccountResourceMetadata, required — AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.
            - `id` string, required — Unique identifier for the resource (prefixed ULID, e.g., "apikey_01HXK...")
            - `accountId` string, required — Account this resource belongs to for multi-tenant isolation (prefixed ULID)
            - `name` string, required — Human-readable name for the resource (e.g., "Customer Support Agent", "Email Tool") Required for resources that users interact with directly
            - `externalId` string — External ID for the resource (e.g., a workflow ID from an external system)
            - `labels` object — Arbitrary key-value pairs for categorization and filtering Examples: {"environment": "production", "team": "platform", "version": "v2"}
            - `profileId` string, required
          - `spec` ProfileSpec, required — Configuration for a profile.
            - `email` string — Email address of the profile. Required and unique within an account for user profiles.
            - `name` string — Display name (e.g., "Bobby Tables").
            - `type` 'PROFILE_TYPE_UNSPECIFIED' | 'PROFILE_TYPE_USER' | 'PROFILE_TYPE_API_KEY' | 'PROFILE_TYPE_SYSTEM', enum, required — Whether this profile represents a human user, an API key, or a system principal.

## Acknowledgement `200`

Webhook received successfully

---

[API](https://skmtc.dev/cadenya/apis/cadenya-api.md) · [All operations](https://skmtc.dev/cadenya/apis/cadenya-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cadenya/cadenya-api/revisions/ea07a25ab5da/schema)
