This guide demonstrates how to set up a complete event-driven pipeline: an EventBus, a Webhook EventSource, and a Sensor that triggers an Argo Workflow upon receiving an HTTP POST request.
1. Deploy Argo Events components
Apply the following manifests to set up the infrastructure:
# Set up the eventbus
kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/eventbus/native.yaml
# Create the webhook event source
kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/webhook.yaml
# Create the webhook sensor
kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/webhook.yaml
2. Expose the EventSource
To send requests to the event-source pod, use port-forwarding (or configure an Ingress/OpenShift Route):
kubectl -n argo-events port-forward <event-source-pod-name> 12000:12000
3. Trigger the Workflow
Send an HTTP POST request using curl or Postman:
curl -d '{"message":"this is my first webhook"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example
4. Verify the Result
Check that a workflow was created and inspect its logs:
# Check for the workflow
kubectl -n argo-events get wf
# Check the workflow logs
argo logs -n argo-events @latest
Note: The workflow logs will contain the event context and the event data. The data field is base64 encoded.