Swirls

SWIRLS_

  • How it works
  • Pricing

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6

56 matches

OverviewDeliver client operations10Win and grow accounts8Resolve customer issues6Create and distribute content9Run people and operations5Review money and agreements3Monitor systems and data9Compose dependable work6
← PatternsWebhookView on GitHub

Wait Node Delayed Follow-up

Sends email immediately, then waits 3 days before a follow-up.

emailwait

Source

/**
 * Demonstrates the wait node. Sends a welcome email immediately,
 * then waits 3 days before sending a check-in.
 */

webhook new_user {
  label: "New User"
  schema: @json {
    {
      "type": "object",
      "required": ["email", "name"],
      "properties": {
        "email": { "type": "string", "format": "email" },
        "name": { "type": "string" }
      }
    }
  }
}

workflow delayed_followup {
  label: "Delayed Follow-up"

  root {
    type: code
    label: "Extract user"
    code: @ts { return context.nodes.root.input }
    outputSchema: @json {
      {
        "type": "object",
        "properties": {
          "email": { "type": "string", "format": "email" },
          "name": { "type": "string" }
        }
      }
    }
  }

  node send_welcome {
    type: email
    label: "Send welcome"
    from: @ts { return "[email protected]" }
    to: @ts { return context.nodes.root.output.email }
    subject: @ts { return "Welcome, " + context.nodes.root.output.name + "!" }
    text: @ts {
      return "Hi " + context.nodes.root.output.name + ",\n\nWelcome aboard! We are excited to have you."
    }
  }

  node wait_3_days {
    type: wait
    label: "Wait 3 days"
    amount: 3
    unit: "days"
  }

  node send_checkin {
    type: email
    label: "Send check-in"
    from: @ts { return "[email protected]" }
    to: @ts { return context.nodes.root.output.email }
    subject: @ts { return "How is it going, " + context.nodes.root.output.name + "?" }
    text: @ts {
      return "Hi " + context.nodes.root.output.name + ",\n\nJust checking in. Is there anything we can help you with? Reply to this email anytime."
    }
  }

  flow {
    root -> send_welcome
    send_welcome -> wait_3_days
    wait_3_days -> send_checkin
  }
}

trigger on_new_user {
  webhook:new_user -> delayed_followup
  enabled: true
}

Flow

Trigger to workflow

new_userwebhook
delayed_followup
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 user
EMAIL
Email Node
Send welcome
WAIT
Wait Node
Wait 3 days
EMAIL
Email Node
Send check-in
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.