Set Variable Node

Create new variables or transform existing ones in the workflow context. Use it to flatten deeply nested data, combine fields, format values, or create aliases for long variable paths.

How It Works

  1. Add one or more key-value pairs
  2. The Key is the variable name you want to create
  3. The Value supports {{variable}} syntax to reference upstream context
  4. All configured keys are added to the workflow context and available to downstream nodes as {{keyName}}
Use Set Variable to simplify complex variable paths. Instead of writing {{razorpayTrigger.payload.payment.entity.contact}} in every downstream node, set customerPhone once and use {{customerPhone}} everywhere.

Configuration

NameTypeRequiredDefaultDescription
keystringYesVariable name to create. Use camelCase, e.g. customerPhone or orderTotal
valuestringYesValue to assign. Supports plain text, numbers, and {{variable}} references

You can add multiple key-value pairs in a single Set Variable node. All pairs are processed together.

Examples

Flatten Razorpay Payment Data

textConfiguration
Key: customerName   Value: {{razorpayTrigger.payload.payment.entity.notes.name}}
Key: customerPhone  Value: {{razorpayTrigger.payload.payment.entity.contact}}
Key: customerEmail  Value: {{razorpayTrigger.payload.payment.entity.email}}
Key: amountPaise    Value: {{razorpayTrigger.payload.payment.entity.amount}}
Key: paymentId      Value: {{razorpayTrigger.payload.payment.entity.id}}

Downstream nodes can now use {{customerName}}, {{customerPhone}}, etc. instead of long paths.

Combine Fields

textConfiguration
Key: fullName   Value: {{body.firstName}} {{body.lastName}}
Key: fullAddress Value: {{body.address}}, {{body.city}} - {{body.pincode}}

Mark Step Completion

textConfiguration
Key: orderCreated   Value: true
Key: shipmentId     Value: {{shiprocket.shipment_id}}
Key: processedAt    Value: {{razorpayTrigger.receivedAt}}

Complete Workflow

Use case: Simplify a post-payment workflow by normalising all variable names upfront.

textWorkflow
Razorpay Trigger (payment.captured)
→ Set Variable
    customerName:  {{razorpayTrigger.payload.payment.entity.notes.name}}
    customerPhone: {{razorpayTrigger.payload.payment.entity.contact}}
    customerEmail: {{razorpayTrigger.payload.payment.entity.email}}
    orderAmount:   {{razorpayTrigger.payload.payment.entity.amount}}
    paymentId:     {{razorpayTrigger.payload.payment.entity.id}}
→ Shiprocket — Create Order
    billingName:  {{customerName}}
    billingPhone: {{customerPhone}}
    billingEmail: {{customerEmail}}
→ MSG91 — Send SMS
    mobile:  {{customerPhone}}
    message: "Hi {{customerName}}, your order is confirmed!"
  • Code — for complex transformations that require JavaScript logic
  • If / Else — use Set Variable to prepare values before conditional branching
  • Razorpay Trigger — flatten deep payment payload fields