Pricing engine — JavaScript + C#
Two script nodes share one calculation: JavaScript computes the margin, then the sandboxed C# node applies tax — the same payload flows through both languages.
What’s inside
4 nodes — every type links to its full reference page.
| Step | Node | Type |
|---|---|---|
| Price inputs | Inject | input.inject |
| Margin (JS) | JavaScript | utility.javascript |
| Tax (C#) | C# | utility.csharp |
| Price card | Console | utility.console |
Import it
- Studio → Import — paste the JSON below (or the URL
/docs/templates/pricing-engine-javascript-c.json). - Or ask the AI Copilot with the JSON pasted after the phrase:
import this workflow json into a new workflow named "Pricing engine — JavaScript + C#" - Any credentials the nodes need are
${credential.…}references — add them once in Admin → Credentials and the template picks them up. Nothing secret ships in a template.
The workflow document (flowdrome.workflow.v1, 4 node types)
{
"schemaVersion": "flowdrome.workflow.v1",
"id": "",
"name": "Pricing engine — JavaScript + C#",
"version": "0",
"status": "draft",
"nodes": [
{
"id": "seed",
"type": "input.inject",
"label": "Price inputs",
"category": "trigger",
"config": {
"contentType": "application/json",
"payload": {
"product": "WID-1",
"cost": 6.5,
"listPrice": 10
}
},
"position": {
"x": 0,
"y": 0
}
},
{
"id": "margin",
"type": "utility.javascript",
"label": "Margin (JS)",
"category": "script",
"config": {
"code": "return { ...input, margin: +((input.listPrice - input.cost) / input.listPrice * 100).toFixed(1) };",
"outputs": [
"output"
]
},
"position": {
"x": 530,
"y": 0
}
},
{
"id": "tax",
"type": "utility.csharp",
"label": "Tax (C#)",
"category": "script",
"config": {
"code": "var d = (IDictionary<string, object?>)input; var list = Convert.ToDouble(d[\"listPrice\"]); return new Dictionary<string, object?> { [\"product\"] = d[\"product\"], [\"margin\"] = d[\"margin\"], [\"withTax\"] = Math.Round(list * 1.0825, 2) };",
"timeoutMs": 10000
},
"position": {
"x": 1060,
"y": 0
}
},
{
"id": "out",
"type": "utility.console",
"label": "Price card",
"category": "utility",
"config": {
"message": "{{ $json.product }}: margin {{ $json.margin }}% · shelf price {{ $json.withTax }}"
},
"position": {
"x": 1590,
"y": 0
}
}
],
"edges": [
{
"id": "e0",
"sourceNodeId": "seed",
"sourcePort": "output",
"targetNodeId": "margin",
"targetPort": "input"
},
{
"id": "e1",
"sourceNodeId": "margin",
"sourcePort": "output",
"targetNodeId": "tax",
"targetPort": "input"
},
{
"id": "e2",
"sourceNodeId": "tax",
"sourcePort": "output",
"targetNodeId": "out",
"targetPort": "input"
}
],
"triggers": [
{
"id": "t0",
"nodeId": "seed"
}
],
"meta": {
"snippets": [],
"source": "template-gallery",
"description": "Two script nodes share one calculation: JavaScript computes the margin, then the sandboxed C# node applies tax — the same payload flows through both languages."
}
} Generated from the verified demo corpus — this exact document seeds and runs on a fresh Flowdrome. Raw JSON: pricing-engine-javascript-c.json.