AI Development

How Do You Build an AI Agent Workflow After OpenAI DevDay 2026? 2026 Decisions API, JSON Tools, and Structured Data in Practice

About 15 min read

DevDay on 2026-09-29 set the split. Decisions API went GA on 2026-10-22 with native input_json and up to 400 questions. Long tool loops stay on Responses / Agents. The model only fills JSON; the host runs decision → tool → structured in order.

Before you read

Layer 2026 official surface Host job
Route / classify POST /v1/decisions, gpt-6-luna; predicate / choice / score; input_json for ticket + order Map choice to the next API—no tools here
Tools and side effects Responses function_call + function_call_output; Agents API for Computer Use / multi-agent Validate arguments with Schema, run lookup_order, write back call_id
Structured delivery Responses text.format json_schema or summarize tool results; host keeps customer_visible Separate from raw tool output
State workflow_id, response_id, last_decision; async tools in pending_async Continue with previous_response_id—do not drop reasoning items

Facts through 2026-10-26: Decisions GA (changelog), Decisions guide input_json, DevDay 2026 recap. A-1042, T-8841, wf_demo_3a are fictional.

The workflow is decide first, tool second, structured delivery last

Before DevDay, many teams stuffed classify, lookup, and reply into one Chat Completions loop. After DevDay the official split is clearer: bounded questions go to Decisions (docs cite up to ~10× faster than the same model via Responses); side-effecting lookup_order stays on Responses; long-running browser or sub-agent work moves to Agents API. The October 2026 GA lets you put input_json on user content—no need to stringify ticket objects into the prompt first. That moves “context JSON” to a specific layer in your pipeline.

  • Decisions: choice / probability / score—route, risk gate, escalate or not.
  • Responses tools: function_call for real queries; structured output for user-facing JSON.
  • Agents API: hosted harness, Computer Use, tool search—you still own state writeback.

What shipped: DevDay ship list. Field migration: API migration. Responses vs Agents: Agents vs Responses. This piece is a workflow walkthrough, not “what is JSON Schema.”

Decision → tool → output → state

Step one: put structured evidence on Decisions, not a giant prompt. The guide uses input_json data for ticket and order:

{
  "model": "gpt-6-luna",
  "input": [{
    "role": "user",
    "content": [
      { "type": "input_text", "text": "Route this ticket using the order record." },
      { "type": "input_json", "data": {
          "ticket": { "id": "T-8841", "topic": "billing" },
          "order": { "order_id": "A-1042", "status": "paid" }
      }}
    ]
  }],
  "questions": [{
    "type": "choice",
    "name": "route",
    "instructions": "Pick the next host action. Do not call tools here.",
    "choices": [
      { "value": "lookup", "description": "Call lookup_order" },
      { "value": "hold", "description": "Stop and wait" },
      { "value": "escalate", "description": "Hand to a person" }
    ]
  }]
}

Step two: only when route is lookup, register tools on Responses. Set strict; the host still validates:

{
  "type": "function",
  "name": "lookup_order",
  "strict": true,
  "parameters": {
    "type": "object",
    "properties": {
      "order_id": { "type": "string", "pattern": "^[A-Z]-\\d{4}$" }
    },
    "required": ["order_id"],
    "additionalProperties": false
  }
}

Step three: the model returns function_call. Parse the arguments string, execute, write back with the same call_id:

{
  "type": "function_call",
  "call_id": "call_3c91",
  "name": "lookup_order",
  "arguments": "{\"order_id\":\"A-1042\"}"
}

Step four: after function_call_output, another Responses turn can emit user-visible fields via json_schema:

{
  "type": "function_call_output",
  "call_id": "call_3c91",
  "output": "{\"order_id\":\"A-1042\",\"status\":\"paid\",\"amount\":99.00}"
}

The host binds decision, response_id, and structured fields in workflow state so the next turn does not re-guess route:

{
  "workflow_id": "wf_demo_3a",
  "step": "after_tool",
  "last_decision": { "name": "route", "choice": "lookup" },
  "response_id": "resp_9f2b",
  "pending_async": [],
  "structured": { "customer_visible": "Your order A-1042 is paid." }
}

Four API faces—do not share one parser

Wrong entrypoints stack latency and cost. Split by official boundaries:

You need Use
Pick next step from a fixed set (lookup / hold / escalate) Decisions choice; input_json + cached shared context
Call REST, DB, mutate records Responses function_call; slow tools with async: true + same call_id output
Multi-step browse, sub-agents, Computer Use Agents API; turn_id writeback, not function_call_output shape
JSON contract for users / downstream Responses structured output or host map from tool result to schema

OpenAI’s 2026-10-22 Decisions post highlights Box document routing and Datadog scoring shell risk on the hot path—the pattern is decision JSON separate from execution JSON. A Decisions choice is not a completed lookup.

Six steps to a testable workflow from zero

Run fictional orders in staging with JSON diff before switching production model IDs:

  1. Draw the state machine. Which transitions are enum-only (Decisions) vs tool side effects (Responses).
  2. Define the input_json contract. Fixed ticket / order field names; align with CRM export JSON for JSONPath.
  3. Register tools and strict. One side effect per function; validate arguments before execute.
  4. Map choice → action. lookup → Responses with order_id; escalate → queue, no lookup_order.
  5. Split raw vs visible. Store full tool output; structured.customer_visible only allowed fields.
  6. Record response_id and decision. Continue with previous_response_id; audit each hop with JSON Diff.

Migrating old Chat Completions loops: change writeback shapes before model IDs—see the migration post; do not swap step order with this list.

Spread three JSON kinds before launch

Typical bugs: choice is escalate but function_call still fires, or structured fields copy raw secrets from tool output.

  • Use format on arguments; Schema validation on tool and structured schemas.
  • Use JSON Diff between Decisions before/after, tool output vs customer_visible.
  • Use JSONPath on input_json for $.order.order_id and match function_call arguments.
  • On Decisions refusal, do not start the tool chain.
  • JSONSort runs locally—do not paste production PII or keys.

When the three align, the workflow is your state machine—not the model improvising APIs.

Common mistakes

  • Using Responses for pure routing. If choice fits, do not pay for a full tool round and reasoning tokens.
  • Pretending Decisions calls tools. Questions return answers only; execution is host-side.
  • Treating input_json as a dump. Undocumented fields drift routing—fix the contract first.
  • One object for structured and tool output. User JSON should be smaller and stable.
  • Mixing Agents and Responses call_id parsers. Writeback shapes differ.
  • Ignoring async ordering. Do not duplicate function_call before slow-tool output arrives.

FAQ

After Decisions GA, should I route with Chat Completions?

New routing should use Decisions + gpt-6-luna. Legacy Completions loops can move to Responses (migration post); hot-path classification favors Decisions.

input_json vs stringify JSON into the prompt?

Official structured objects live in the content part data field—fewer escaping bugs and field alignment with ticket systems.

Can structured output replace function_call?

No. Structured output constrains model-generated JSON; lookups still need function_call + host execution.

Does Agents API include Decisions?

Separate surfaces. Agents hosts long tasks and Computer Use; you can still call Decisions as a gate before Agents.

Who cares about the 400-question limit?

Batch QA and log labeling can pack many questions per Decisions call; simple support routing usually needs one to three choices.

Conclusion

Post–DevDay 2026 agent workflows layer JSON by job: Decisions for bounded routing and scoring, Responses for tools and structured delivery, Agents for hosted long tasks. October GA input_json frees context JSON from prompt strings.

Draw the state machine first, then fill the four JSON templates. The model still only fills fields—whether to lookup or what the user sees stays a host decision.

Further reading

Changelog: First published