Onboarding Email Sequence
Sends personalized onboarding emails tailored to plan and use case.
aiemail
Source
/**
* Sends a personalized onboarding email when a new customer signs up.
* Tailors content based on their plan and use case.
*/
webhook new_signup {
label: "New Signup"
schema: @json {
{
"type": "object",
"required": ["email", "name", "plan"],
"properties": {
"email": { "type": "string", "format": "email" },
"name": { "type": "string" },
"plan": { "type": "string", "enum": ["starter", "pro", "enterprise"] },
"use_case": { "type": "string" }
}
}
}
}
workflow onboard_customer {
label: "Onboard Customer"
root {
type: code
label: "Extract signup"
code: @ts { return context.nodes.root.input }
outputSchema: @json {
{
"type": "object",
"properties": {
"email": { "type": "string" },
"name": { "type": "string" },
"plan": { "type": "string" },
"use_case": { "type": "string" }
}
}
}
}
node personalize {
type: ai
label: "Personalize welcome"
kind: object
model: "google/gemini-2.5-flash"
prompt: @ts {
const user = context.nodes.root.output
return "Write a personalized onboarding email for " + user.name + " on the " + user.plan + " plan. Use case: " + (user.use_case || "general") + ". Include 3 specific next steps tailored to their plan. Keep it warm and actionable."
}
schema: @json {
{
"type": "object",
"required": ["subject", "body", "next_steps"],
"properties": {
"subject": { "type": "string" },
"body": { "type": "string" },
"next_steps": { "type": "array", "items": { "type": "string" } }
}
}
}
temperature: 0.7
}
node send_welcome {
type: email
label: "Send welcome email"
from: @ts { return "[email protected]" }
to: @ts { return context.nodes.root.output.email }
subject: @ts { return context.nodes.personalize.output.subject }
text: @ts {
const content = context.nodes.personalize.output
const steps = content.next_steps.map(function(step, i) { return (i + 1) + ". " + step }).join("\n")
return content.body + "\n\nYour next steps:\n" + steps
}
}
flow {
root -> personalize
personalize -> send_welcome
}
}
trigger on_signup {
webhook:new_signup -> onboard_customer
enabled: true
}
Flow
Trigger to workflow
new_signupwebhook
onboard_customer
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Workflow nodes
CODE
Code Node
Extract signup
AI
AI Node
Personalize welcome
EMAIL
Email Node
Send welcome email
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.