Skip to main content
Use this recipe when one support workflow should:
  • inherit routing and prompt defaults from a dashboard preset
  • return strict structured output
  • pause risky cases for human review
  • keep gateway failures visible in logs instead of hiding them inside agent code

1. Start with a preset

Create a preset such as support-triage that owns:
  • the default routed model or router target
  • provider preferences
  • the support-system prompt
  • stable decoding parameters
That keeps the agent code focused on workflow control instead of duplicating request policy.

2. Define a narrow triage contract

Keep the first output shape small enough that operators can inspect it quickly.

3. Create the preset-driven agent

The SDK resolves preset: "support-triage" to the gateway alias form @support-triage.

4. Configure the gateway-backed adapter

Use adapter defaults for the parts that should stay fixed across every triage run:

5. Run the workflow with bounded retries

If the run pauses for review, resume it explicitly:

6. Treat gateway failures as operational events

Do not hide failures by swallowing them inside the agent callback chain. Instead, catch AgentGatewayError explicitly:
Then:
  1. let the runtime persist failed run and step state
  2. inspect loaded.run.errorDetails or loaded.steps[n].errorDetails on later recovery paths when the original exception is no longer in memory
  3. inspect the request details for:
    • guardrail enforcement
    • routing details
    • plugin execution
    • request ids and provider data
That is especially important when:
  • a guardrail blocks the request
  • the preset allowlist rejects the requested model
  • provider credentials or enablement filters remove the routed candidate set
  • response healing fails to recover schema-valid JSON

7. What to verify

After one successful run and one intentionally risky run, confirm:
  • the request detail view shows the preset-driven request target
  • high-risk cases pause in waiting_for_human
  • retrying model steps persist modelAttempts
  • guardrail or preset failures remain visible in request details, not hidden inside agent exceptions
Last modified on July 26, 2026