Guide: Send Email on Trigger

Build the simplest useful workflow: run it manually, and it sends an email. A good first workflow to verify your setup end-to-end.

What you will build:

Manual Trigger → Code (build body) → Send Email

Time: ~10 minutes

Prerequisites:

  • Tensorify account with a workspace
  • Resend account with a verified domain
  • CLI installed: npm install -g @tensorify.io/cli

Step 1: Add RESEND_API_KEY

Before building the workflow, add your Resend API key to the workspace:

  1. Go to SettingsEnv Vars
  2. Click Add Variable
  3. Name: RESEND_API_KEY, Value: your key from resend.com/api-keys

Step 2: Create the Workflow

  1. Dashboard → New Workflow → name it send-test-email
  2. Click Create

Step 3: Add a Manual Trigger

Drag a Manual node onto the canvas. In its settings:

  • Mock Payload: paste this test data so you have values available during testing:
{
  "recipientName": "Ada Lovelace",
  "recipientEmail": "[email protected]",
  "message": "This is a test notification from Tensorify."
}

Step 4: Add a Code Node

Drag a Code node and connect Manual Trigger's payload output to Code's input.

In the code editor:

name = input.get("body", {}).get("recipientName", "there")
message = input.get("body", {}).get("message", "")

return f"""Hi {name},

{message}

Sent via Tensorify.
"""

Step 5: Add Send Email

Drag a Send Email node and connect Code's result to Send Email's text input.

In the Send Email settings:

  • From: [email protected] (must be a verified Resend domain)
  • To: {{ manual.body.recipientEmail }}
  • Subject: Hello, {{ manual.body.recipientName }}

Step 6: Test It

Start the watch loop:

export TENSORIFY_API_KEY="your_key_here"
tensorify watch send-test-email-workflow-id

In the canvas editor:

  1. Click Test → select the Send Email node → click Run to Selected
  2. The workflow runs locally using the mock payload
  3. Check the inbox of the address in mockPayload.recipientEmail

The Code node's output panel in the canvas will show the formatted string that was passed to Send Email.

Step 7: Run It in Production

This is a manual-trigger workflow, so you don't need a webhook URL. Run it directly with the CLI:

tensorify run send-test-email-workflow-id

Or trigger it from the canvas by clicking the Run button.


What You Learned

  • How to use a Manual Trigger with test payload data
  • How to use a Code node to build a dynamic string from trigger data
  • How to use {{ }} bindings in email settings to personalize the recipient and subject
  • The complete development loop: build → test with watch → run in production

Next Steps

On this page