Deploy with Webhooks
Make your agent react to the world in real time. Use SmythOS agents as event-driven webhooks to connect with external services like Discord, Google Chat, and any webhook-based platform.
Why Connect Webhooks to Your Agent?
Webhooks let your SmythOS agent act like an event listener. When a trigger happens elsewhere... like a form being submitted, a database record changing, or a user message coming in... the source system instantly sends a payload to your agent’s webhook URL. This is ideal for:
- Real-time message posting (e.g., Discord integration)
- Task automation (e.g., Google Chat or Notion updates)
- Event-based workflows with external triggers
Unlike polling, webhooks are instantaneous, efficient, and perfect for reactive agent workflows.
Prerequisites for Webhook Deployments
Before you begin, make sure you:
- Have an existing deployed SmythOS agent. If not, deploy your agent here.
- Understand the webhook format of your target platform (e.g., Discord, Google Chat).
- Have appropriate authentication set up via Vault → API Keys.
Step 1: Create a Webhook-Ready Endpoint
-
In your SmythOS Agent:
- Add an Agent Skill component and name it something like
WebhookReceiver
. - Define the inputs your target service will send (e.g.,
event
,message
,timestamp
).
- Add an Agent Skill component and name it something like
-
Follow it with a Code Component or LLM Component to process the input.
-
End the workflow with an API Output component to format and return a valid HTTP response to the caller.
Step 2: Secure the Webhook Endpoint
Open webhooks are risky. Always protect your endpoints.
Use one of the following authentication options:
Bearer Token Authentication
- Generate your token in agent settings and store it in Vault.
- Enable Bearer Token Auth in agent settings and provide your token.
- All incoming requests must include:
Authorization: Bearer your-token
OAuth OIDC Authentication
- For SSO or email-domain restricted flows.
- Set up via your SmythOS organization settings.
See Authentication Setup for full details.
Step 3: Connect Your Platform to the Webhook
Once your agent has a public, secure endpoint:
- Go to your selected third-party service
- Navigate to their webhook configuration area (e.g., Discord Server Settings, Google Chat Space Settings)
- Paste your agent’s endpoint URL
- Map outgoing fields from the service to your agent’s expected inputs
Always consult the official platform docs to match formatting expectations.
Payload Format Examples
Google Chat:
{
"text": "Hello from SmythOS!"
}
Discord:
{
"content": "Alert: New event triggered by your agent!"
}
Step 4: Process the Webhook Data in SmythOS
Configure these components to handle incoming webhook data:
- Webhook Handler (Agent Skill) – Receives the POST request
- Code Component – Parses and validates the payload
- LLM Prompt (Optional) – Adds AI logic or dynamic reasoning
- API Output – Formats the final response for the external platform
Use defensive logic in the Code Component to handle missing or malformed inputs.
Step 5: Format and Return a Response
Return a payload structured for the target platform:
Discord:
{
"content": "Here’s your update!",
"embeds": [{
"title": "SmythOS Webhook Triggered",
"description": "Workflow completed with output: ${data.output}"
}]
}
Google Chat:
{
"text": "Your request was processed successfully."
}
Always test using Postman, curl, or the platform’s native test tools.
Step 6: Register and Activate the Webhook
Finally, register the webhook URL in your platform:
- Discord: Server Settings → Integrations → Webhooks → Create
- Google Chat: Space Settings → Add Incoming Webhook
- Notion: Use Zapier or Make to trigger workflows
- Zapier: Choose "Webhook" as the trigger/action and enter your agent’s URL
Once registered, your agent will begin receiving POST data from the platform in real time.
Example Integration: Zapier + SmythOS
Use Zapier to trigger your agent from thousands of apps:
- Set a Zapier trigger (e.g., "New row in Google Sheet")
- Add a Webhook Action to POST data to your agent
- Your SmythOS agent processes and responds to the payload
What’s Next?
- Explore Slack, WhatsApp, or Telegram webhook flows
- Build advanced workflows triggered by multiple external sources
- Add logging to monitor and debug webhook activity
- Consider MCP deployment for higher control and flexibility