Expression Builder and Declare Variable can both use data sources, functions, arithmetic, and multi-step calculations. The difference is whether the value should continue to refresh or be captured once and retained.
Use Declare Variable for a snapshot. Use Expression Builder for a condition that must stay live.
| Requirement | Declare Variable | Expression Builder |
|---|---|---|
| When it calculates | When the node executes | Whenever its parent condition checks |
| Data source values | Captured and frozen | Refreshed |
| Calculated output | Retained for the workflow run | Recalculated |
| Best suited for | Remembering a value or selection | Monitoring a changing condition |
| Option selection | Can keep one selected contract fixed | Can reselect as data changes |
| Candle data | Fixed captured window | Moving window |
| Arithmetic | Supported | Supported |
| Functions | Supported | Supported |
Use it when the requirement includes concepts such as:
Examples:
Use it when the value must continue changing with the data.
Examples:
Use both when the strategy compares a saved reference value with something live.
For example:
“Alert when live LTP is 10% above the LTP when the automation started.”
Use:
If a normal Automate node already supports the exact requirement, use that node.
For example:
“Alert when RELIANCE LTP is above ₹3,000.”
No advanced calculated baseline is required.
| Scenario | What to do |
|---|---|
| What if mathematics is involved? | That alone does not determine which node to use. Both Declare Variable and Expression Builder support mathematics. |
| What if I need today's selected option to remain fixed? | Use Declare Variable. |
| What if the selected option should change whenever the ranking changes? | Use Expression Builder. |
| What if one part is fixed and another part is live? | Use both. Declare Variable can retain the fixed value while Expression Builder evaluates the live value. |
Last updated: 26 Aug 2026