kubiya_webhook
resource allows you to create and manage webhooks in the Kubiya platform. Webhooks enable external systems to trigger Kubiya agents or workflows via HTTP requests, facilitating event-driven automation and real-time integrations.
Webhooks are essential for building responsive automation systems that react to external events like code pushes, deployment notifications, alerts, and data changes.
Prerequisites
Before using this resource, ensure you have:- A Kubiya account with API access
- An API key (generated from Kubiya dashboard under Admin → Kubiya API Keys)
- At least one configured agent or workflow to trigger
- Appropriate integrations configured for notification methods (Slack, Teams)
Quick Start
Configuration Examples
Create a webhook for automated incident response:
Advanced Configurations
Conditional Workflows
Conditional Workflows
Create webhooks with conditional logic based on runtime conditions:
Teams Integration
Teams Integration
Configure webhook with Microsoft Teams notifications:
Arguments Reference
Required Arguments
The name of the webhook. Must be unique within your organization.
Conditional Required Arguments
Eitheragent
or workflow
must be specified:
The name of the agent to trigger with this webhook. Required if no workflow is specified.
JSON-encoded workflow definition to execute when webhook is triggered. Required if no agent is specified.
Optional Arguments
Source identification for the webhook (e.g., “github”, “datadog”, “custom”). Helps with organizing and filtering webhooks.
Filter expression for events that will trigger the webhook. Use to restrict webhook triggers to specific conditions.
Prompt to send to the agent or workflow when triggered. Provides context for the execution.
The runner to use for workflow execution. Required when using
workflow
parameter.Notification method for webhook results. Available options:
Slack
- Send notifications to Slack channels or usersTeams
- Send notifications to Microsoft TeamsHttp
- Send HTTP notifications
Destination for notifications (varies by method):
- Slack: Channel name with ”#” prefix (e.g., “#alerts”) or username with ”@” prefix
- Teams: Channel name within the team specified by
team_name
- Http: Not required
Team name for Microsoft Teams notifications. Required when
method
is “Teams”.Workflow Structure
When using theworkflow
parameter, the JSON structure should include:
Name of the workflow for identification.
Description of the workflow’s purpose.
Array of workflow steps, each containing:
Unique name for the step.
Description of what the step does.
Executor configuration with
type
and config
properties.Array of step names this step depends on for execution order.
Variable name to store step output for use in subsequent steps.
Attributes Reference
In addition to all arguments above, the following attributes are exported:The unique identifier of the webhook.
The URL to trigger the webhook (sensitive).
The timestamp when the webhook was created.
The user who created the webhook.
The current status of the webhook.
The ID of the associated workflow (when using workflow parameter).
Import
Webhooks can be imported using their ID:Best Practices
Security
- Use filters to restrict webhook triggers to specific events
- Implement proper authentication and authorization for webhook endpoints
- Validate webhook payloads to prevent malicious triggers
- Monitor webhook execution for suspicious activity
Performance
- Design workflows to be efficient and avoid long-running operations
- Use appropriate timeouts and retry mechanisms
- Consider rate limiting for high-frequency webhooks
- Implement proper error handling and recovery
Reliability
- Include error handling steps in workflows
- Set up monitoring and alerting for webhook failures
- Test webhooks with sample payloads before production use
- Implement idempotent operations where possible
Maintenance
- Use descriptive names that indicate the webhook’s purpose and source
- Document expected payload formats and trigger conditions
- Version control your webhook configurations
- Regularly review and update webhook configurations
Compatibility
Requirements:
- Kubiya Terraform Provider version >= 1.0.0
- Terraform >= 1.0
- Workflow support requires appropriate runner configuration
- Notification methods require corresponding integrations to be configured
Important Considerations:
- Some features may require specific Kubiya platform tier
- Be aware of rate limits when designing high-frequency webhooks
- Ensure proper network access for webhook URL endpoints
- Test webhook integrations thoroughly before production deployment
Troubleshooting
Webhook Not Triggering
Webhook Not Triggering
- Verify the webhook URL is accessible from the source system
- Check filter expressions for syntax and logic errors
- Ensure the source system is sending requests in the expected format
- Review webhook logs for error messages
Workflow Execution Issues
Workflow Execution Issues
- Verify the runner is active and has proper permissions
- Check that all required dependencies are available in the execution environment
- Review workflow step dependencies for circular references
- Ensure proper variable passing between workflow steps
Notification Delivery Problems
Notification Delivery Problems
- Verify integration configurations for Slack/Teams
- Check channel names and team configurations
- Ensure proper permissions for notification delivery
- Test notification methods independently