Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Oct 5, 2025

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

  • 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 for response
  • submitted responses are long-running (hours/days) - webhooks will be used

📦 Webhook Payload Format

  • Webhooks POST the complete task response object (not just status notification)
  • 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}/{operation_id}
  • Examples: /create_media_buy/..., /activate_signal/...
  • Enables clear routing based on task type

📢 Status Change Notifications

For submitted operations, webhooks are 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 with examples
  • docs/protocols/task-management.md - Updated webhook integration documentation
  • 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 matching schemas
  • Webhook handler implementation patterns

Test Results

✅ All schema validation tests passed
✅ All example validation tests passed
✅ TypeScript compilation successful
✅ Documentation build successful

## 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>
@bokelley
Copy link
Contributor Author

bokelley commented Oct 5, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants