Workflow JSON generation
2025-10-077 turns21,932 charsgpt-5-t-mini
Summary
User wants to brainstorm and generate JSON for an OpenAI Agent Builder workflow.
Messages
I want to brainstorm and then generate the JSON to copy and paste into OpenAI's Agent Builder so that the workflow will be there. So what I want you to do is to generate that JSON I can copy and paste. But first we need to brainstorm what the workflow will do, so first explore all the possibilities and then help me craft together what this will be
⚙ model reasoning step
gpt-5-t-mini
⚙ model reasoning step
gpt-5-t-mini
⚙ model reasoning step
gpt-5-t-mini
⚙ model reasoning step
gpt-5-t-mini
⚙ model reasoning step
gpt-5-t-mini
Nice — love this. I’ll (A) explore the common building blocks and possibilities you can wire into an OpenAI **Agent Builder** workflow, then (B) give you **six copy-pasteable JSON manifest templates** (different use cases) you can drop into Agent Builder / import into an agents SDK and adapt. I pulled the official OpenAI Agents / Agents SDK and Structured Outputs docs to keep recommendations aligned with platform capabilities. citeturn0search0turn2search12turn0search6turn0search4
---
# A. Core building blocks / possibilities (what your workflow *can* do)
(Short and practical — use these as Lego pieces when we craft the final JSON.)
1. **Triggers**
- Webhook / HTTP POST (external system sends input).
- UI / user prompt (manual start).
- Schedule / cron (periodic jobs).
2. **Agents / Nodes**
- Each agent = a specialized LLM role (system instructions + model + tool access).
- Typical roles: Planner, Retriever/Searcher, Extractor (structure), Verifier, Writer, Actioner (calls external APIs).
3. **Tools**
- Managed platform tools (web search, file/DB retrieval), HTTP connectors (call your APIs), image generator, code interpreter / file parser.
- Tools are declared and given scopes + auth; agents can call them.
4. **Memory**
- Short-term (per request), session memory, or persistent long-term memory (for profiles, past interactions).
5. **Control flow**
- Branching/conditionals (if classifier.intent == 'billing' → route to billing agent).
- Loops and retries (e.g., retry extractor on parse failure).
6. **Human-in-the-loop**
- Pause & ask for human approval before commit (important for destructive actions).
7. **Structured outputs**
- Use JSON Schema / Structured Outputs so the model returns strict JSON fields you can store or pass to tools reliably. (Highly recommended.) citeturn0search6
8. **Observability & safety**
- Logging, rate limits, permission scopes, and explicit „explain why you took this action“ steps to help auditing. OpenAI recommends constrained tool surfaces and safety docs for tool-enabled agents. citeturn0search11turn1search3
---
# B. Pick-and-paste JSON templates
Below are **six** ready JSON manifests (one per use case). Replace placeholders (API keys, endpoint URLs) and tweak prompts to match your brand/requirements. Each template contains:
- `workflow_id`, `name`, `description`
- `triggers`
- `tools`
- `agents` (id, instructions, model, tool access, memory)
- `flow` (the ordering and simple conditionals)
- `response_schema` (JSON Schema for the final structured output)
> Note: different OpenAI tooling/SDK versions and the Agent Builder UI can have slightly different import keys. These manifests follow a *practical, import-friendly* manifest shape used by Agent/SDK ecosystems (agents + tools + flow + schema). If you want, I’ll adapt any one into the exact importer format your Agent Builder expects — tell me which template and your Agent Builder export sample (or I can inspect a pasted example) and I’ll adapt it exactly.
---
## 1) Research Assistant — multi-agent research pipeline
Use: automated research + citation-backed summary.
```json
{
"workflow_id": "research_assistant_v1",
"name": "Research Assistant — Multi-Agent Pipeline",
"description": "Take a user question, plan a search, gather sources, extract facts, verify claims, and produce a structured summary with citations.",
"triggers": [
{ "type": "webhook", "path": "/webhook/research", "method": "POST" },
{ "type": "ui", "input_schema": { "type": "object", "properties": { "query": { "type": "string" } }, "required": ["query"] } }
],
"tools": [
{ "id": "web_search", "type": "managed", "description": "Platform-managed web search (managed search tool)", "config": {} },
{ "id": "mcp_doc_search", "type": "managed", "description": "Private file / repo search (MCP)", "config": {} },
{ "id": "http_fetch", "type": "http", "description": "Generic HTTP tool for API calls", "config": { "base_url": "https://api.example.com", "auth_header": "Bearer {{API_KEY}}" } }
],
"agents": [
{
"id": "planner",
"name": "Planner",
"model": "gpt-4o-mini",
"instructions": "Given the user query, produce a short plan: search terms, which sources to query, and extraction targets (facts to collect). Output JSON: { plan: string, searches: [string], extract_targets: [string] }",
"tools": []
},
{
"id": "searcher",
"name": "Searcher",
"model": "gpt-4o-mini",
"instructions": "Run the searches from planner. Use web_search and mcp_doc_search to fetch top N pages or docs and return a list of candidate source snippets with URLs and short relevance scores.",
"tools": ["web_search", "mcp_doc_search"]
},
{
"id": "extractor",
"name": "Fact Extractor",
"model": "gpt-4o-mini",
"instructions": "From each candidate source, extract the requested targets. Return structured JSON items with fields: source_url, snippet, extracted_facts[]. Use strict JSON Schema for outputs.",
"tools": []
},
{
"id": "verifier",
"name": "Verifier",
"model": "gpt-4o-mini",
"instructions": "Cross-check extracted facts across sources and rate confidence (high/medium/low). Add citations list of URLs for each fact.",
"tools": []
},
{
"id": "summarizer",
"name": "Summarizer",
"model": "gpt-4o-mini",
"instructions": "Produce a final structured summary and suggested next actions for the user.",
"tools": []
}
],
"flow": [
{ "step": 1, "agent": "planner", "on": "start" },
{ "step": 2, "agent": "searcher", "on": "planner.output.plan" },
{ "step": 3, "agent": "extractor", "on": "searcher.output" },
{ "step": 4, "agent": "verifier", "on": "extractor.output" },
{ "step": 5, "agent": "summarizer", "on": "verifier.output" }
],
"response_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"summary": { "type": "string" },
"key_findings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fact": { "type": "string" },
"confidence": { "type": "string", "enum": ["high", "medium", "low"] },
"citations": { "type": "array", "items": { "type": "string", "format": "uri" } }
},
"required": ["fact", "confidence", "citations"]
}
},
"next_steps": { "type": "array", "items": { "type": "string" } }
},
"required": ["summary", "key_findings"]
}
}
```
**Notes**: good fit for research tasks that need citations. Use platform managed web search & MCP (private corpora). Structured Outputs ensures JSON consistency. citeturn0search6turn2search4
---
## 2) Customer Support Triage & Ticketing
Use: route messages, auto-draft replies, create tickets and escalate.
```json
{
"workflow_id": "support_triage_v1",
"name": "Customer Support Triage",
"description": "Classify incoming messages, attempt an automatic reply for simple cases, and create/route tickets via an HTTP ticketing API. Human approval required for escalations.",
"triggers": [
{ "type": "webhook", "path": "/webhook/support", "method": "POST" }
],
"tools": [
{ "id": "ticket_api", "type": "http", "description": "Helpdesk API", "config": { "base_url": "https://helpdesk.example.com", "auth_header": "Bearer {{TICKET_API_KEY}}" } },
{ "id": "email_send", "type": "http", "description": "Email sender API", "config": { "base_url": "https://email.example.com", "auth_header": "Bearer {{EMAIL_KEY}}" } }
],
"agents": [
{
"id": "classifier",
"name": "Intent & Urgency Classifier",
"model": "gpt-4o-mini",
"instructions": "Classify the incoming message into: product_issue, billing, account, feedback, other. Also score urgency: low/medium/high. Output strict JSON."
},
{
"id": "autoresponder",
"name": "AutoResponder",
"model": "gpt-4o-mini",
"instructions": "For simple cases (low urgency & common intents), generate a help reply with steps. If confidence < 0.7, do not auto-send."
},
{
"id": "ticket_creator",
"name": "Ticket Creator",
"model": "gpt-4o-mini",
"instructions": "Build ticket payload and call ticket_api to create ticket. If urgency == high, add escalation flag. Wait for human approval when escalate==true.",
"tools": ["ticket_api"]
}
],
"flow": [
{ "step": 1, "agent": "classifier", "on": "start" },
{ "step": 2, "agent": "autoresponder", "on": "classifier.output", "condition": "classifier.output.urgency == 'low' && classifier.output.intent != 'billing'" },
{ "step": 3, "agent": "ticket_creator", "on": "classifier.output", "condition": "classifier.output.urgency != 'low' || classifier.output.intent == 'billing'" }
],
"response_schema": {
"type": "object",
"properties": {
"action_taken": { "type": "string" },
"ticket_id": { "type": ["string", "null"] },
"reply_draft": { "type": ["string", "null"] }
},
"required": ["action_taken"]
}
}
```
**Notes**: include a `human_approval` pause when escalation is set. Secure ticket API keys in env/secrets.
---
## 3) Content Generation → SEO → Publish
Use: blog post pipeline: ideation → research → draft → SEO polish → CMS publish + image generate.
```json
{
"workflow_id": "content_publish_v1",
"name": "Content Generation & Publish Pipeline",
"description": "Given a topic input, generate title ideas, do quick research, create an outline and draft, optimize for SEO, generate images, and publish to CMS via API.",
"triggers": [
{ "type": "ui", "input_schema": { "type": "object", "properties": { "seed_topic": { "type": "string" } }, "required": ["seed_topic"] } }
],
"tools": [
{ "id": "cms_api", "type": "http", "description": "CMS API", "config": { "base_url": "https://cms.example.com", "auth_header": "Bearer {{CMS_KEY}}" } },
{ "id": "image_gen", "type": "managed", "description": "Image generation tool (image_gen)", "config": {} },
{ "id": "web_search", "type": "managed", "description": "Web search for reference and fact-check", "config": {} }
],
"agents": [
{ "id": "ideator", "name": "Title & Angle Ideator", "model": "gpt-4o-mini", "instructions": "Propose 5 titles and a recommended angle & target keywords." },
{ "id": "researcher", "name": "Quick Researcher", "model": "gpt-4o-mini", "instructions": "Fetch key stats and citations for the draft; return bullet facts and sources.", "tools": ["web_search"] },
{ "id": "outliner", "name": "Outliner", "model": "gpt-4o-mini", "instructions": "Produce an H1/H2/H3 outline and recommended word counts per section." },
{ "id": "writer", "name": "Writer", "model": "gpt-4o-mini", "instructions": "Write the post following the outline and incorporate cited facts." },
{ "id": "seo", "name": "SEO Optimizer", "model": "gpt-4o-mini", "instructions": "Produce meta title, meta description, suggested tags, and an SEO-friendly slug." },
{ "id": "image_creator", "name": "Image Creator", "model": "gpt-4o-mini", "instructions": "Generate image prompts for image_gen and call it. Return asset URLs.", "tools": ["image_gen"] },
{ "id": "publisher", "name": "CMS Publisher", "model": "gpt-4o-mini", "instructions": "Assemble the final payload and call cms_api to create a draft post.", "tools": ["cms_api"] }
],
"flow": [
{ "step": 1, "agent": "ideator", "on": "start" },
{ "step": 2, "agent": "researcher", "on": "ideator.output" },
{ "step": 3, "agent": "outliner", "on": "researcher.output" },
{ "step": 4, "agent": "writer", "on": "outliner.output" },
{ "step": 5, "agent": "seo", "on": "writer.output" },
{ "step": 6, "agent": "image_creator", "on": "seo.output" },
{ "step": 7, "agent": "publisher", "on": "image_creator.output" }
],
"response_schema": {
"type": "object",
"properties": {
"post_url": { "type": ["string", "null"] },
"cms_draft_id": { "type": ["string", "null"] },
"images": { "type": "array", "items": { "type": "string", "format": "uri" } }
}
}
}
```
**Notes**: include SEO checks and a human preview step before publishing if desired.
---
## 4) Document ingestion & structured extraction (PDF → DB)
Use: upload PDFs, parse them (code sandbox), extract structured data, and persist into DB.
```json
{
"workflow_id": "doc_extract_v1",
"name": "Document Extraction (PDF → DB)",
"description": "Accept uploaded documents (PDF/DOCX), run a parser to extract sections, named entities and tables, then write structured records to a DB via HTTP API.",
"triggers": [
{ "type": "webhook", "path": "/webhook/upload", "method": "POST" }
],
"tools": [
{ "id": "file_parser", "type": "managed", "description": "Platform file parser / code interpreter", "config": {} },
{ "id": "db_api", "type": "http", "description": "DB ingestion API", "config": { "base_url": "https://db.example.com", "auth_header": "Bearer {{DB_KEY}}" } }
],
"agents": [
{
"id": "uploader",
"name": "Uploader",
"model": "gpt-4o-mini",
"instructions": "Validate the uploaded file, confirm type, and return a parse plan."
},
{
"id": "parser",
"name": "Parser",
"model": "gpt-4o-mini",
"instructions": "Call file_parser to extract text, tables, and images. Return structured JSON according to schema.",
"tools": ["file_parser"]
},
{
"id": "extractor",
"name": "Entity Extractor",
"model": "gpt-4o-mini",
"instructions": "From parsed text, extract named entities and fill the DB record format.",
"tools": []
},
{
"id": "db_writer",
"name": "DB Writer",
"model": "gpt-4o-mini",
"instructions": "Send structured records to db_api and report ingestion result.",
"tools": ["db_api"]
}
],
"flow": [
{ "step": 1, "agent": "uploader", "on": "start" },
{ "step": 2, "agent": "parser", "on": "uploader.output" },
{ "step": 3, "agent": "extractor", "on": "parser.output" },
{ "step": 4, "agent": "db_writer", "on": "extractor.output" }
],
"response_schema": {
"type": "object",
"properties": {
"ingested_records": { "type": "integer" },
"errors": { "type": "array", "items": { "type": "string" } }
},
"required": ["ingested_records"]
}
}
```
**Notes**: use screenshots for PDF pages when debugging (platform screenshot tools for PDFs). Be mindful of file size/timeouts.
---
## 5) DevOps → GitHub issue triage & PR skeletons
Use: triage GitHub issues, label and assign, optionally open PR templates.
```json
{
"workflow_id": "devops_triage_v1",
"name": "DevOps Issue Triage & PR Creator",
"description": "When a GitHub issue webhook arrives, classify severity, assign labels, create a PR skeleton if actionable, and notify on Slack (or return suggested actions).",
"triggers": [
{ "type": "webhook", "path": "/webhook/github", "method": "POST" }
],
"tools": [
{ "id": "github_api", "type": "http", "description": "GitHub API", "config": { "base_url": "https://api.github.com", "auth_header": "Bearer {{GITHUB_TOKEN}}" } },
{ "id": "slack_api", "type": "http", "description": "Slack webhook", "config": { "base_url": "https://hooks.slack.com", "auth_header": "Bearer {{SLACK_KEY}}" } }
],
"agents": [
{ "id": "issue_classifier", "name": "Issue Classifier", "model": "gpt-4o-mini", "instructions": "Classify type (bug/feature/infra/docs), estimate severity, and create suggested labels and assignees." },
{ "id": "labeler", "name": "Labeler/Assigner", "model": "gpt-4o-mini", "instructions": "Call github_api to apply labels and assign team members.", "tools": ["github_api"] },
{ "id": "pr_creator", "name": "PR Creator", "model": "gpt-4o-mini", "instructions": "If issue is actionable, create PR skeleton with branch name and PR body; optionally open a draft PR via github_api.", "tools": ["github_api"] },
{ "id": "notifier", "name": "Notifier", "model": "gpt-4o-mini", "instructions": "Send a Slack notification with summary and links.", "tools": ["slack_api"] }
],
"flow": [
{ "step": 1, "agent": "issue_classifier", "on": "start" },
{ "step": 2, "agent": "labeler", "on": "issue_classifier.output" },
{ "step": 3, "agent": "pr_creator", "on": "issue_classifier.output", "condition": "issue_classifier.output.actionable == true" },
{ "step": 4, "agent": "notifier", "on": "labeler.output" }
],
"response_schema": {
"type": "object",
"properties": {
"applied_labels": { "type": "array", "items": { "type": "string" } },
"created_pr": { "type": ["string", "null"] },
"notifications_sent": { "type": "boolean" }
},
"required": ["applied_labels"]
}
}
```
**Notes**: GitHub tokens should be scoped minimally (repo:labels, issues, pulls). Add human-approval step for destructive actions.
---
## 6) Financial / Portfolio Multi-Agent Analyst
Use: scheduled market analysis, collect market data, run multi-agent evaluations, and produce a short report + signals.
```json
{
"workflow_id": "portfolio_analyst_v1",
"name": "Portfolio Multi-Agent Analyst",
"description": "Scheduled daily run: fetch market data, run quantitative analyzers and news sentiment, synthesize recommendations, and publish report or trigger trades (requires approval).",
"triggers": [
{ "type": "schedule", "cron": "0 14 * * Mon-Fri" }
],
"tools": [
{ "id": "market_api", "type": "http", "description": "Market data API", "config": { "base_url": "https://market.example.com", "auth_header": "Bearer {{MARKET_KEY}}" } },
{ "id": "news_search", "type": "managed", "description": "News search tool", "config": {} },
{ "id": "trade_api", "type": "http", "description": "Execution API (requires human approval)", "config": { "base_url": "https://trade.example.com", "auth_header": "Bearer {{TRADE_KEY}}" } }
],
"agents": [
{ "id": "collector", "name": "Data Collector", "model": "gpt-4o-mini", "instructions": "Pull price history, positions, and latest news snippets.", "tools": ["market_api", "news_search"] },
{ "id": "quant", "name": "Quant Analyst", "model": "gpt-4o-mini", "instructions": "Run analysis scripts (or request numeric calculations), output signals with confidence." },
{ "id": "risk", "name": "Risk Evaluator", "model": "gpt-4o-mini", "instructions": "Assess risk metrics for suggested trades." },
{ "id": "reporter", "name": "Reporter", "model": "gpt-4o-mini", "instructions": "Assemble daily report and list recommended actions." },
{ "id": "executor", "name": "Executor (manual)", "model": "gpt-4o-mini", "instructions": "When human approves, call trade_api to execute small test orders.", "tools": ["trade_api"] }
],
"flow": [
{ "step": 1, "agent": "collector", "on": "schedule" },
{ "step": 2, "agent": "quant", "on": "collector.output" },
{ "step": 3, "agent": "risk", "on": "quant.output" },
{ "step": 4, "agent": "reporter", "on": "risk.output" },
{ "step": 5, "agent": "executor", "on": "reporter.output", "condition": "human_approval == true" }
],
"response_schema": {
"type": "object",
"properties": {
"report_summary": { "type": "string" },
"signals": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ticker": { "type": "string" },
"action": { "type": "string", "enum": ["buy", "sell", "hold"] },
"confidence": { "type": "number" },
"rationale": { "type": "string" }
},
"required": ["ticker", "action", "confidence"]
}
}
},
"required": ["report_summary"]
}
}
```
**Notes**: financial automation is high-risk — keep executor behind manual approval and strict logs.
---
# Final notes, tips, and next steps
1. **Structured outputs**: all templates include a `response_schema`. Use the platform's JSON Schema / Structured Outputs to ensure model returns valid JSON. citeturn0search6
2. **Tool safety**: declare tools with minimal scopes and add human approval where side effects exist (ticket creation, trades). OpenAI docs emphasize narrowing tool surfaces. citeturn0search11turn1search3
3. **Import into Agent Builder**: open `platform.openai.com` → Agents / Agent Builder, look for Import / JSON/YAML option (UI may vary); paste and adjust keys (tools/auth) in your environment. citeturn0search4turn0search0
4. **Customize**: replace model names (e.g., `gpt-4o-mini`) with the models your org uses, and swap tool `base_url` and `auth` placeholders for your secrets.
5. **If you want 1 exact JSON** that fits the **exact import schema** of your Agent Builder UI, paste a small example export from your Agent Builder (or tell me the exact required keys) and I’ll adapt one of the templates to match exactly.
---
Would you like me to:
- A) generate a single final JSON adapted to **one** of the templates above (I can pick a default like Research Assistant), or
- B) adapt one of these to match a **specific importer schema** you paste here, or
- C) proceed and generate a merged multi-purpose manifest that supports several flows behind conditionals?
Say A, B, or C and which template number if A/C — then I’ll output the final copy-paste JSON ready for your Agent Builder. (No waiting; I’ll produce it right here.)
gpt-5-t-mini