docs: clarify webhook behavior for async operations#92
Closed
bokelley wants to merge 1 commit into
Closed
Conversation
## Summary
Documents webhook notification format and trigger behavior for asynchronous
AdCP operations, addressing confusion about when webhooks are called and
what payload format is sent.
## Changes
### Webhook Trigger Behavior
- **Key rule**: Webhooks are ONLY called when initial response is `submitted`
- `completed`/`failed` responses are synchronous - no webhook needed
- `working` responses complete within ~120s - no webhook, just wait
- `submitted` responses are long-running (hours/days) - webhooks used
### Webhook Payload Format
- Webhooks POST the complete task response object (not just status)
- Each webhook matches the task's response schema exactly
- For `create_media_buy`: full create-media-buy-response.json structure
- For `activate_signal`: full activate-signal-response.json structure
### Webhook URL Pattern
- Use task name in URL: `/webhooks/adcp/{task_name}/{agent_id}/{op_id}`
- Examples: `/create_media_buy/...`, `/activate_signal/...`
- Enables clear routing based on task type
### Status Change Notifications
For `submitted` operations, webhooks called on:
- `input-required` → Human needs to respond/approve
- `completed` → Operation finished successfully
- `failed` → Operation failed with error details
- `canceled` → Operation was canceled
## Files Modified
- docs/protocols/core-concepts.md - Added comprehensive webhook section
- docs/protocols/task-management.md - Updated webhook integration docs
- docs/media-buy/task-reference/create_media_buy.md - Clarified webhook flow
- docs/signals/tasks/activate_signal.md - Added webhook examples
## Examples Added
- Human-in-the-loop approval flow with webhooks
- Synchronous vs async operation handling
- Complete webhook payload structures
- Webhook handler implementation patterns
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
Closing this PR - changes have been consolidated into PR #86 which contains comprehensive webhook documentation including security, reliability, and the async operation behavior clarifications from this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents webhook notification format and trigger behavior for asynchronous AdCP operations, addressing confusion about when webhooks are called and what payload format is sent.
Key Changes
🎯 Webhook Trigger Behavior
submittedcompleted/failedresponses are synchronous - no webhook neededworkingresponses complete within ~120s - no webhook, just wait for responsesubmittedresponses are long-running (hours/days) - webhooks will be used📦 Webhook Payload Format
create_media_buy: fullcreate-media-buy-response.jsonstructureactivate_signal: fullactivate-signal-response.jsonstructure🔗 Webhook URL Pattern
/webhooks/adcp/{task_name}/{agent_id}/{operation_id}/create_media_buy/...,/activate_signal/...📢 Status Change Notifications
For
submittedoperations, webhooks are called on:input-required→ Human needs to respond/approvecompleted→ Operation finished successfullyfailed→ Operation failed with error detailscanceled→ Operation was canceledFiles Modified
docs/protocols/core-concepts.md- Added comprehensive webhook section with examplesdocs/protocols/task-management.md- Updated webhook integration documentationdocs/media-buy/task-reference/create_media_buy.md- Clarified webhook flowdocs/signals/tasks/activate_signal.md- Added webhook examplesExamples Added
Test Results
✅ All schema validation tests passed
✅ All example validation tests passed
✅ TypeScript compilation successful
✅ Documentation build successful