A practical field guide from Automation Ace.
Short answer: to go from a webhook to a ChatGPT workspace agents run, catch the event in Zapier, Make, or n8n, filter and deduplicate it, then add an HTTP POST step to https://api.chatgpt.com/v1/workspace_agents/{agtch_id}/trigger with Authorization: Bearer <Workspace Agent access token> and a JSON body with input built from your mapped fields (plus an optional conversation_key). Add OpenAI-Beta: workspace_agent_runs=v1 to get a run ID, store it with the conversation_url, and let the agent deliver its results with its own tools, since the API does not return the agent's answer.
Details reflect OpenAI's workspace agent trigger docs at the time of writing; run status polling was in beta.
Short answer
- Publish the agent with an API channel; copy the
agtch_trigger ID. - Create a Workspace Agent access token and store it as a credential.
- Catch the event, filter, and deduplicate.
- POST
input(andconversation_key) with the bearer token and beta header. - Save
agent_trigger_run_idandconversation_url; notify the owner. - Track status and have the agent post results where your team works.
Why trigger a workspace agent from an automation
Workspace agents live in ChatGPT, where your team builds and reviews them. Your automation platform knows when things happen in every other app. Connecting them means a new lead, ticket, invoice, or form submission can start an agent without anyone opening ChatGPT.
- Lead intake: a form submission starts research and a draft reply.
- Support: a tagged ticket starts triage and a suggested answer.
- Finance and ops: a new invoice or vendor request starts checks and a summary.
- Reports: a scheduled automation starts a weekly analysis at the exact time you choose.
Who should do what: AI agents vs automations.
The webhook-to-agent flow
Source app (form, CRM, help desk, Stripe, your app)
│ webhook or app trigger
▼
Zapier / Make / n8n
1. Catch the event (Catch Hook, Custom webhook, Webhook node)
2. Filter: only events the agent should handle
3. Deduplicate: skip event IDs already sent
4. Build "input" text from mapped fields
5. POST to https://api.chatgpt.com/v1/workspace_agents/{agtch_id}/trigger
6. Save run ID + conversation URL to a table; notify the owner
▼
ChatGPT workspace agent runs in the background and delivers results
with its own tools (Slack, CRM, sheet), or a person reviews the conversation
Step 1: Prepare the agent and token
- In the workspace agent builder, add an API channel, save, and publish. Copy the trigger ID (starts with
agtch_). - In ChatGPT Admin → Access tokens, create a token with the Workspace Agents scope. An admin must allow these tokens first.
- Make sure the token's user can use the agent.
- Give the agent the connected apps it needs to deliver results, and nothing more.
The full API walkthrough is in how to trigger a ChatGPT workspace agent via API.
Step 2: The request you are building
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.chatgpt.com/v1/workspace_agents/agtch_.../trigger |
| Header | Authorization: Bearer <Workspace Agent access token> |
| Header | Content-Type: application/json |
| Header (optional, beta) | OpenAI-Beta: workspace_agent_runs=v1 to get a run ID |
| Body | {"input": "...", "conversation_key": "..."} |
| Success | 202 Accepted with conversation_url (may be null) and, with the beta header, agent_trigger_run_id |
Step 3: Design the input
input is plain text. A short task line followed by labeled fields works well:
New inbound lead from the website form.
Task: research the company, score fit (high/medium/low) with one reason,
and draft a first reply. Post the result in #sales-leads and tag the owner.
Name: {{name}}
Email: {{email}}
Company: {{company}}
Team size: {{team_size}}
Message: {{message}}
CRM record: {{crm_url}}
- conversation_key: use a stable ID (ticket, thread, or lead ID) when follow-ups should continue the same conversation.
- Trim long fields and leave out data the agent does not need.
- Say where results go, because the API will not return them.
Zapier: Webhooks by Zapier
| Zapier step | Setting |
|---|---|
| Trigger | Webhooks by Zapier → Catch Hook, or any app trigger (new form entry, new ticket) |
| Filter | Only continue for events the agent should handle |
| Action | Webhooks by Zapier → POST (or Custom Request) |
| URL | The trigger URL with your agtch_ ID |
| Payload Type | json |
| Data | input = your template; conversation_key = a stable ID (optional) |
| Headers | Authorization = Bearer <token>; OpenAI-Beta = workspace_agent_runs=v1 |
| Next step | Save agent_trigger_run_id and conversation_url to Zapier Tables, Airtable, or a sheet |
Payload Type json builds and escapes the body for you. Related: Webhooks by Zapier, API by Zapier vs Webhooks by Zapier, and passing data in webhook requests.
Make: HTTP module
| Make module | Setting |
|---|---|
| Trigger | Webhooks → Custom webhook, or an app module |
| Filter | On the route after the trigger |
| Build the body | JSON → Create JSON with input and conversation_key fields |
| Request | HTTP → Make a request: POST, the trigger URL, the headers above, body = the JSON output |
| Parse response | Yes, so you can map the run ID and conversation URL |
| Error handling | A route for 4xx responses that records the error and alerts you |
Build the body with Create JSON instead of typing JSON by hand, so quotes and line breaks in mapped fields do not break the request. See calling any API with the Make HTTP module and Make webhook examples.
n8n: HTTP Request node
| n8n node | Setting |
|---|---|
| Trigger | Webhook node, or an app trigger node |
| Filter | IF or Filter node |
| Credential | Header Auth: name Authorization, value Bearer <token> |
| Request | HTTP Request node: POST, the trigger URL, header OpenAI-Beta |
| Body | JSON, using fields below: input (expression) and conversation_key |
| After | Write the run ID to a data table, sheet, or database |
Store the token as a Header Auth credential, not in the node. Comparing tools: Zapier vs Make vs n8n.
After the 202: tracking and results
- Record each run: source event ID, run ID, conversation URL, time sent, and status
queued, in Airtable, Zapier Tables, a Make data store, or a sheet. - Notify the owner with the conversation URL when one is returned.
- Poll the run status to catch failures and stuck runs; see how to monitor workspace agent runs by tracking run status.
- Close the loop with a second automation that reacts when the agent posts its result (a new Slack message, an updated CRM field).
Duplicates, retries, and volume
- Deduplicate first: webhooks can arrive twice, and each accepted trigger starts a run; see webhook deduplication.
- Retry carefully: 401, 403, 404, and 409 will not fix themselves on retry; fix the setup instead. Retry timeouts only after checking you did not already get a run ID.
- Filter hard: send only events that need judgment; route simple ones with rules.
- Watch usage: agent runs consume workspace resources; batch or schedule noisy sources.
Platform-neutral patterns: how to trigger an AI agent from an API or webhook. The same approach for Claude Code: triggering Claude Code from Zapier, Make, or n8n.
Troubleshooting
| What you see | Likely cause | Fix |
|---|---|---|
| 401 | Wrong token type (for example an OpenAI API key), expired, or revoked | Use a Workspace Agent access token |
| 403 | The token's user cannot use this agent | Share the agent with that user or use a token from someone who can |
| 404 | Wrong or mistyped agtch_ ID, or a different workspace | Copy the trigger ID again from the API channel |
| 409 | Agent or API channel not runnable (unpublished draft, disabled) | Publish the agent; check the channel and workspace settings |
| 400 or broken body | Hand-typed JSON broke on quotes or line breaks | Let the tool build the JSON |
| 202 but no run ID | The OpenAI-Beta header is missing | Add OpenAI-Beta: workspace_agent_runs=v1 |
| Two runs for one event | Webhook delivered twice or step retried | Deduplicate by event ID before the POST |
| Run completes, nothing happens | The agent was not told where to put results | Add delivery instructions to the input or the agent |
Frequently asked questions
Can I trigger a ChatGPT workspace agent from Zapier?
Yes. Add a Webhooks by Zapier POST action to https://api.chatgpt.com/v1/workspace_agents/{agtch_id}/trigger with Payload Type json, an input field built from mapped data, and headers for Authorization: Bearer with a Workspace Agent access token and OpenAI-Beta: workspace_agent_runs=v1 if you want a run ID.
How do I trigger a workspace agent from Make?
Build the body with a JSON Create JSON module containing input and optionally conversation_key, then use the HTTP Make a request module to POST it to the trigger URL with the Authorization bearer token and optional OpenAI-Beta header, and parse the response to map the run ID.
How do I trigger a workspace agent from n8n?
Use an HTTP Request node with POST to the trigger URL, a Header Auth credential for Authorization: Bearer and the Workspace Agent access token, an OpenAI-Beta header for a run ID, and a JSON body with an input field built from an expression.
How do I get the workspace agent’s answer back into my automation?
The trigger API does not return the agent’s output. Instruct the agent to deliver results with its connected apps, such as posting to Slack or updating a CRM record, share the conversation URL with a reviewer, and poll the run status to know when it finished.
How do I avoid duplicate workspace agent runs from webhooks?
Store each source event ID and skip ones already sent, filter out events that do not need the agent, avoid automatic retries on 4xx errors, and only retry a timeout after confirming no run ID was returned.
Disclaimer: ChatGPT workspace agents and the Workspace Agents API (including run status polling, which was in beta) change quickly; details reflect public documentation and coverage at the time of writing, so confirm current details with each provider before building. Automation Ace is not affiliated with OpenAI or the other companies named here. This article may include links to apps, products, or services; some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.