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 (only for local testing): curl -fsSL https://cli.tensorify.io/install | sh — or skip and deploy with Managed mode

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

Using Managed mode? Skip this step — deploy from the Deploy dialog with Managed execution and trigger via the canvas Run button.

Start a runner for local testing:

tensorify init
tensorify login              # opens browser — or use --api-key on init
tensorify runner start

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. Trigger it from the canvas by clicking Run, or deploy it from the Deploy dialog with Managed mode for cloud execution (no runner needed) or CLI mode for self-hosted.


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 → deploy in production

Next Steps


Why Use Resend API for Workflow Emails?

Resend provides a modern, developer-friendly email API with excellent deliverability out of the box. Unlike legacy SMTP providers, Resend handles SPF/DKIM automatically, offers real-time delivery webhooks, and requires zero server configuration — you just need an API key stored as an environment variable.

Tensorify's Send Email node wraps the Resend API so you can send transactional emails as part of any workflow without writing boilerplate HTTP request code.

Alternative: Using Any Email Provider

If you prefer SendGrid, Mailgun, Postmark, or another provider, use the HTTP Request node to call their REST API directly. The pattern is identical — store your API key in environment variables, configure the request body with {{ }} template bindings, and wire it into your workflow.

On this page