Guide: Webhook Automation

Build a workflow that receives a GitHub push event, extracts commit information, and sends an email notification to your team.

What you will build:

Webhook Trigger (GitHub) → Transform → Send Email (Resend)

Time: ~15 minutes

Prerequisites:

  • Tensorify account with a workspace
  • Resend account with a verified domain (resend.com)
  • A GitHub repository where you can add webhooks
  • CLI installed: npm install -g @tensorify.io/cli

Step 1: Create the Workflow

  1. Go to app.tensorify.io → dashboard
  2. Click New Workflow and name it github-push-notifications
  3. Click Create

Step 2: Add a Webhook Trigger

Drag a Webhook node onto the canvas. In its settings panel:

  • Path: /github/push
  • Method: POST
  • Verification Type: hmac-signature
  • Signature Header Name: X-Hub-Signature-256
  • Signature Algorithm: sha256
  • Response Mode: ack-immediately

Leave the Secret field empty for now — you will fill it after GitHub generates the webhook.

Step 3: Add a Transform Node

Drag a Transform node onto the canvas and connect the Webhook's payload output to Transform's input.

In the Transform settings, set the template to:

{
  "pusherName": "{{ webhook.body.pusher.name }}",
  "repoName": "{{ webhook.body.repository.full_name }}",
  "branch": "{{ webhook.body.ref }}",
  "commitCount": "{{ webhook.body.commits.length }}",
  "latestMessage": "{{ webhook.body.head_commit.message }}",
  "compareUrl": "{{ webhook.body.compare }}"
}

Step 4: Add Send Email

First, add your RESEND_API_KEY to your workspace:

  1. Go to SettingsEnv Vars (or directly to the Env Vars page)
  2. Add a variable named RESEND_API_KEY with your Resend API key

Now drag a Send Email node onto the canvas and connect Transform's result to Send Email's text input.

The text input expects a plain text string, but Transform produces an object. To build the email body as a string, insert a Code node between Transform and Send Email instead. See Step 4b below.

Step 4b: Add a Code Node for the Body

Drag a Code node between Transform and Send Email. Connect Transform's result to Code's input.

repo = input.get("repoName", "unknown")
branch = input.get("branch", "").replace("refs/heads/", "")
pusher = input.get("pusherName", "someone")
count = input.get("commitCount", 0)
message = input.get("latestMessage", "")
url = input.get("compareUrl", "")

return f"""{pusher} pushed {count} commit(s) to {repo} ({branch})

Latest: {message}

Compare: {url}"""

Connect Code's result to Send Email's text input.

In the Send Email settings:

Step 5: Test Locally

Install the CLI and set your API key:

export TENSORIFY_API_KEY="your_key_here"
tensorify watch github-push-notifications-workflow-id

In the canvas editor, open the Webhook node settings and add a mock payload:

{
  "pusher": { "name": "octocat" },
  "repository": { "full_name": "octocat/my-repo" },
  "ref": "refs/heads/main",
  "commits": [{}],
  "head_commit": { "message": "Fix typo in README" },
  "compare": "https://github.com/octocat/my-repo/compare/abc...def"
}

Click Test → select the Send Email node → click Run to Selected. Check your inbox.

Step 6: Deploy

  1. Click Deploy in the toolbar
  2. Set Execution Mode to CLI (or Managed if you don't want to run the CLI)
  3. Copy the Webhook URL

In GitHub:

  1. Go to your repository → SettingsWebhooksAdd webhook
  2. Set Payload URL to your Tensorify webhook URL
  3. Set Content type to application/json
  4. Set Secret to a random string (e.g., from openssl rand -hex 32)
  5. Copy that secret back into the Webhook node's Secret field in Tensorify

If using CLI mode, start your runner:

tensorify run github-push-notifications-workflow-id

Step 7: Verify

Make a commit and push to your repository. Within seconds you should receive an email and see a completed job on the Jobs page.


What You Learned

  • How to configure HMAC-signature verification for GitHub webhooks
  • How to use Transform to extract specific fields from a complex payload
  • How to use a Code node to build a formatted string
  • How to deploy and verify a production webhook workflow

Next Steps

On this page