SendGrid Webhooks for Email Nurturing Workflows: A Step-by-Step Guide
Did you know the average person receives around 121 emails per day? With inboxes constantly flooded, how can your email stand out and earn that crucial click? The key lies in personalization and timing–sending the right email at the right moment based on user engagement. Email nurturing is a powerful B2B strategy to build relationships with potential clients by guiding them through time-based campaigns. Whether it’s encouraging them to take an offer, sign up for a demo, or schedule a consultation, well-timed follow-ups can significantly improve lead conversion. SendGrid’s webhooks help automate this process by tracking real-time email events such as opens, clicks, bounces, and more. When integrated with a platform like Orkes Conductor, the Unified Application Platform, these events can trigger automated and personalized responses. This guide demonstrates how to leverage SendGrid webhooks to create an automated email nurturing workflow. Building an email nurturing flow To illustrate how email nurturing works, let’s use the example of a product launch email campaign. When the campaign is sent, we consider two key scenarios: subscribers who open the email and those who click a link. To further nurture interest, follow-up emails are customized based on subscriber engagement. Here’s the workflow to achieve this: emailNurturing workflow in Orkes Conductor The Wait for Webhook task listens for incoming event payloads from SendGrid webhooks, while the Switch task determines the follow-up action based on whether the event is an open or a click. The Wait task introduces a grace period before follow-up emails are sent via an HTTP task using SendGrid’s API. Here’s an overview of the system we are going to build: Create an email nurturing workflow in Conductor. Get the API key from the SendGrid account. Store the SendGrid API key as a Secret in Conductor. Create a webhook in Conductor. Configure a webhook event in SendGrid. Modify and run Conductor workflow. Create a Single Send in SendGrid. Automate the flow using Conductor’s Workflow Scheduler. Follow the tutorial using the free Orkes Developer Edition. Sign up for an account to get started. Step 1: Create an email nurturing workflow In Orkes Conductor, application flows can be built as JSON workflows using SDKs, APIs, or Conductor UI. In this tutorial, let’s create the workflow using Conductor UI. To create the workflow: Go to Definitions > Workflows from the left navigation menu on your Conductor cluster. Select + Define workflow. Select the Code tab on the right and paste the following code: { "name": "emailNurturing", "description": "An email nurturing flow", "version": 1, "tasks": [ { "name": "webhook", "taskReferenceName": "webhook_ref", "inputParameters": { "matches": { "request[0].event": "${workflow.input.input}" } }, "type": "WAIT_FOR_WEBHOOK" }, { "name": "switch_event", "taskReferenceName": "switch_ref", "inputParameters": { "switchCaseValue": "${webhook_ref.output.request[0].event}" }, "type": "SWITCH", "decisionCases": { "click": [ { "name": "wait_before_click_follow_up", "taskReferenceName": "wait_ref_1", "inputParameters": { "duration": "10 seconds" }, "type": "WAIT" }, { "name": "send_click_follow_up_email", "taskReferenceName": "http_1_ref", "inputParameters": { "uri": "https://api.sendgrid.com/v3/mail/send", "method": "POST", "accept": "application/json", "contentType": "application/json", "encode": true, "body": { "personalizations": [ { "to": [ { "email": "${webhook_ref.output.request[0].email}" } ], "subject": "

Did you know the average person receives around 121 emails per day? With inboxes constantly flooded, how can your email stand out and earn that crucial click? The key lies in personalization and timing–sending the right email at the right moment based on user engagement.
Email nurturing is a powerful B2B strategy to build relationships with potential clients by guiding them through time-based campaigns. Whether it’s encouraging them to take an offer, sign up for a demo, or schedule a consultation, well-timed follow-ups can significantly improve lead conversion.
SendGrid’s webhooks help automate this process by tracking real-time email events such as opens, clicks, bounces, and more. When integrated with a platform like Orkes Conductor, the Unified Application Platform, these events can trigger automated and personalized responses.
This guide demonstrates how to leverage SendGrid webhooks to create an automated email nurturing workflow.
Building an email nurturing flow
To illustrate how email nurturing works, let’s use the example of a product launch email campaign.
When the campaign is sent, we consider two key scenarios: subscribers who open the email and those who click a link. To further nurture interest, follow-up emails are customized based on subscriber engagement.
Here’s the workflow to achieve this:
emailNurturing workflow in Orkes Conductor
The Wait for Webhook task listens for incoming event payloads from SendGrid webhooks, while the Switch task determines the follow-up action based on whether the event is an open or a click.
The Wait task introduces a grace period before follow-up emails are sent via an HTTP task using SendGrid’s API.
Here’s an overview of the system we are going to build:
- Create an email nurturing workflow in Conductor.
- Get the API key from the SendGrid account.
- Store the SendGrid API key as a Secret in Conductor.
- Create a webhook in Conductor.
- Configure a webhook event in SendGrid.
- Modify and run Conductor workflow.
- Create a Single Send in SendGrid.
- Automate the flow using Conductor’s Workflow Scheduler.
Follow the tutorial using the free Orkes Developer Edition. Sign up for an account to get started.
Step 1: Create an email nurturing workflow
In Orkes Conductor, application flows can be built as JSON workflows using SDKs, APIs, or Conductor UI.
In this tutorial, let’s create the workflow using Conductor UI.
To create the workflow:
- Go to Definitions > Workflows from the left navigation menu on your Conductor cluster.
- Select + Define workflow.
- Select the Code tab on the right and paste the following code:
{
"name": "emailNurturing",
"description": "An email nurturing flow",
"version": 1,
"tasks": [
{
"name": "webhook",
"taskReferenceName": "webhook_ref",
"inputParameters": {
"matches": {
"request[0].event": "${workflow.input.input}"
}
},
"type": "WAIT_FOR_WEBHOOK"
},
{
"name": "switch_event",
"taskReferenceName": "switch_ref",
"inputParameters": {
"switchCaseValue": "${webhook_ref.output.request[0].event}"
},
"type": "SWITCH",
"decisionCases": {
"click": [
{
"name": "wait_before_click_follow_up",
"taskReferenceName": "wait_ref_1",
"inputParameters": {
"duration": "10 seconds"
},
"type": "WAIT"
},
{
"name": "send_click_follow_up_email",
"taskReferenceName": "http_1_ref",
"inputParameters": {
"uri": "https://api.sendgrid.com/v3/mail/send",
"method": "POST",
"accept": "application/json",
"contentType": "application/json",
"encode": true,
"body": {
"personalizations": [
{
"to": [
{
"email": "${webhook_ref.output.request[0].email}"
}
],
"subject": "