Skip to main content

Agent Completion ExecModule

Overview

AgentCompletionModule is the terminal, local boundary for a durable agent workflow. Version 2.0 declares the input it actually requires, documents both outputs it emits, rejects unsafe shapes and unbounded answers, and exposes the contract through Workflow Studio metadata.

The module does not call a model or decide whether an answer is correct. Upstream agent decision, tool execution, approval, retrieval-policy, and evidence-validation steps must establish that the workflow is ready to finish. Agent Completion only copies that validated answer into the terminal output.

Usage

  1. Run the agent decision and any required tool, approval, and verification steps.
  2. Write the validated user-visible text to workflow state as agentFinalAnswer.
  3. Add Agent Completion as the terminal module.
  4. Consume finalAnswer as the user-facing result and agentOutcome as the fixed terminal control signal.

Do not use this module to bypass a pending approval, retryable provider failure, incomplete deployment, or low-confidence retrieval policy.

Inputs

InputTypeRequiredDescriptionConstraints
agentFinalAnswerstringYesValidated answer prepared by the preceding agent flow.Non-blank; maximum 65,536 Java characters.

The value is classified as confidential because a final answer can contain tenant, project, or user context. Non-string objects are rejected instead of being converted with toString().

Outputs

OutputTypeConditionDescription
finalAnswerstringSuccessThe validated answer copied without trimming or rewriting.
agentOutcomestringSuccessAlways final_answer.

The output map is cleared before every attempt. A failed attempt cannot leave a previous successful answer in workflow state.

IntegrationAccount Requirements

No IntegrationAccount is required or read. Agent Completion performs no authentication, credential lookup, model inference, API request, network access, persistence, or external delivery.

Any upstream model or tool module remains responsible for its own READY IntegrationAccount, scopes, destinations, approvals, and provider-specific limits.

Configuration

The module has no configuration fields. Its contract is entirely input-driven so a workflow cannot silently substitute a configured answer for the value validated during the current run.

Operations

The module exposes one deterministic terminal operation:

  1. Clear prior output.
  2. Require agentFinalAnswer to be a string-like value.
  3. Reject blank content and content longer than 65,536 characters.
  4. Copy the answer to finalAnswer without modification.
  5. Emit agentOutcome: final_answer.

For identical input, repeated execution produces identical output and has no side effects.

Errors and Failure Modes

FailureCauseRetryableRecovery
IllegalArgumentException: agentFinalAnswer is required at agent completionThe field is absent, blank, or not a string.NoSupply the validated answer as a non-blank string.
IllegalArgumentException: agentFinalAnswer exceeds the supported lengthThe answer exceeds 65,536 characters.NoSummarize or store the large artifact separately and provide a bounded final answer.

Errors never include the rejected answer. The workflow halts without a terminal result so callers cannot confuse invalid data with successful completion.

Example

Input workflow state:

{
"agentFinalAnswer": "Deployment completed and the production route is healthy."
}

Expected result:

{
"finalAnswer": "Deployment completed and the production route is healthy.",
"agentOutcome": "final_answer"
}

This result means the workflow reached its terminal module with a valid answer. It does not independently prove the deployment, approval, model call, or upstream evidence.

Notes

  • Pagination: not applicable; the module processes one terminal string.
  • Limits: the answer is bounded to 65,536 Java characters. Store large reports or binary artifacts through their canonical object/file paths and link them from the answer.
  • Idempotency: natural and deterministic for identical input; no idempotency key is required.
  • Rate limits: none; no external service is called.
  • API constraints: none; the module is local and provider-neutral.
  • Destructive behavior: none. It does not mutate business objects or external systems.
  • Observability: execution is monitored, but answer content is not logged by this module.
  • Security: input and output are classified confidential; the module does not expand audience or ACL grants.
  • Runtime boundary: provider correctness, evidence sufficiency, approval state, and retrieval policy remain upstream responsibilities.