New to Flowcode Expressions? Eliminate workflow decision & utility nodes in 3 simple steps: pick your Hornbill variable, choose an operation, and paste the generated expression into your target node field.
&[]
2 Category & Type Casting
💡 Why convert?
3 Operation Parameters
Tokens: YYYY (year), YY (2-digit yr), MM (month), DD (day), HH (24h), mm (min), ss (sec). Delimiters preserved.
🧪 Simulation Mock ValuesIn-Memory Test Inputs
Live Preview Result
In-Memory
Result will appear here
Variables are cleanly structured inside standard script parsing syntax.
Generated Flowcode
&[...]
⚠️ Workflow Designer Notice: Pasting expressions into standard/static fields may trigger a yellow format warning in the Hornbill BPM Designer. In Hornbill, warnings do not block publishing/activation, and the backend engine will evaluate the expression at runtime. Always test in staging before deploying to live workflows.
🛡️ V8 Engine Stability & Best Practice: Hornbill executes expressions inside an embedded Google V8 JIT runtime within core application processes. Expressions must be kept strictly to instantaneous scalar evaluations (simple arithmetic, formatting, dates, slicing). Never write loops (for/while), recursion, or complex scripts—doing so risks consuming unmanaged resources and forcing platform-level defensive blocks.
📖
Hornbill Flowcode User Guide & Manual
How to condense multi-node BPM logic into clean inline expressions
Hornbill BPM workflows normally require multiple Decision nodes, Stage Milestones, or External Automations just to do basic calculations, format dates, or provide fallback defaults. This tool builds inline Flowcode expressions that execute directly inside any node field.
1
Grab Your Variable from Hornbill
Inside your Hornbill workflow (e.g. inside an Update Custom Fields or Send Email node), click the Hornbill Variable Picker icon { } next to any input field. Select the node and attribute you need.
Example Token:&[global['flowcoderefs']['getReqDetails']['custom_1']] or an Intelligent Capture answer.
2
Configure in the Builder
Paste your variable into Step 1 (Primary Base Variable) at the top of the builder. Then select:
Operation Category: Math, Routing, String Transformations, Advanced Logic, or Dates.
Data Conversion:Number(), parseFloat(), parseInt(), or String().
Operation Parameters: Values, conditions, or target formats.
Watch the 🧪 Live Preview Result update instantly with in-memory simulation!
3
Copy & Paste Back into Hornbill
Click Copy Code under the Generated Flowcode deck. Back in your Hornbill workflow node, paste the copied expression into your target field (e.g., in a Custom Date, Custom Integer, or Custom Text field).
When the workflow runs: Hornbill's backend engine evaluates the expression on the fly and saves the result directly—no extra nodes needed!
Click any recipe below to instantly load it into the builder studio:
🛡️ Intelligent Capture Fallback
If an Intelligent Capture form field was left blank by the user, automatically fallback to a safe default string.
Calculate how many days have elapsed between the ticket dateLogged and right now.
&[Math.floor((Date.now() - new Date(...).getTime()) / 86400000)]
🔍 Extract Between Characters
Extract a reference number or username trapped inside parentheses (INC001234).
&[(() => { const s = String(...); return s.substring(...); })()]
£ Currency & 20% VAT Calculation
Multiply a base price token by 1.20 and format as currency with exactly 2 decimal places.
&[(parseFloat(cost) * 1.2).toFixed(2)]
📋 Count Checklist / Multi-Select Items
Count items in comma-separated checklist answers, safely ignoring trailing blanks.
&[(() => { const s = String(ans).trim(); return s ? s.split(',').map(x => x.trim()).filter(Boolean).length : 0; })()]
One of the most frequent sources of workflow bugs in Hornbill is accidental string concatenation.
Why Hornbill tokens act like strings: Even if a field in Hornbill is called "Cost", "Quantity", or "Count", Hornbill's workflow engine frequently passes the token value as a JavaScript string (e.g. "100" instead of 100).
Casting Function
When to Use
Why It Matters
Number(val)
General numeric math & calculations
Prevents "100" + 20 becoming "10020"
parseFloat(val)
Currency, prices, VAT, percentages
Preserves decimal places (e.g. 19.99)
parseInt(val, 10)
Whole integers, counters, routing indexes
Always pass radix 10 to prevent octal parsing
String(val)
Text operations, padding, masking, regex
Guarantees methods like .padStart() or .slice() don't crash on nulls
⚠️ Platform Stability Warning (Gerry's Rule): Flowcode expressions run directly in Google Chrome's V8 engine inside Hornbill's core application processes. You must never introduce tight loops (for/while) or unbounded recursion!
1. Strictly Unsupported by Hornbill
While Hornbill allows sensible customers to use custom expressions to cut down node bloat, it is officially classified as unsupported. If customer workflows introduce unstable code, Hornbill reserves the right to implement defensive restrictions.
2. Delimiter Cleanliness (No Nested Enclosures)
Every Flowcode expression is enclosed in an outer &[...]. When embedding tokens inside expressions, make sure you do not nest enclosures like &[&[...]]. This tool automatically strips inner brackets for you.
3. Hornbill Custom Field Date Formatting
Hornbill Custom Date fields reject timestamps that include hours or time zones. They strictly require the YYYY-MM-DD ISO date format without any time component (e.g. 2026-09-10).
4. Prefer Native Hornbill Nodes Where Feasible
If Hornbill provides a dedicated native automation node for an activity (such as URL decoding or string slicing), consider using the native node first unless combining steps reduces significant workflow complexity.
Q: Where can I paste the generated Flowcode expression?
You can paste it into almost any node input field that accepts text or variables: Update Custom Fields, Log Request, Email Templates, Task Titles / Descriptions, and external webhook parameters.
Q: Why did my calculation output NaN (Not a Number)?
This happens when the Hornbill token contained an empty string or non-numeric characters (like currency symbols £ or commas). In the builder, ensure you use parseFloat() or test with the Fallback operator (e.g. parseFloat(val) || 0).
Q: Can I share a specific Flowcode setup with a colleague?
Yes! Click the Share Link button in the top navigation header. It encodes your entire variable, operation, and mock values into a shareable URL that loads the exact state on any computer.
Q: Does this tool send my Hornbill data or tokens anywhere?
No. This application is 100% client-side, zero-dependency HTML/JavaScript. All calculations, parsing, and live simulation run entirely in your browser's memory.
⚡
Quick Action Templates
Select a preconfigured workflow pattern to jump-start your Flowcode expression