Forecast — Python (imported)

The Python node is the landing pad for IMPORTED Python steps (e.g. from n8n): it holds the code faithfully but the engine has no Python runtime yet — right-click offers a JavaScript conversion, which is exactly what the live lane here does. The original Python step is parked OFF the run path so the demo runs.

What’s inside

4 nodes — every type links to its full reference page.

StepNodeType
Sales history Inject input.inject
Project (converted to JS) JavaScript utility.javascript
Forecast Console utility.console
Original Python (unconverted) Python utility.python

Import it

  1. Studio → Import — paste the JSON below (or the URL /docs/templates/forecast-python-imported.json).
  2. Or ask the AI Copilot with the JSON pasted after the phrase:
    import this workflow json into a new workflow named "Forecast — Python (imported)"
  3. 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": "Forecast — Python (imported)",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Sales history",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "months": [
            12500,
            13100,
            14050
          ]
        }
      },
      "position": {
        "x": 0,
        "y": 228
      }
    },
    {
      "id": "project",
      "type": "utility.javascript",
      "label": "Project (converted to JS)",
      "category": "script",
      "config": {
        "code": "const m = input.months; const growth = (m[2] - m[0]) / 2; return { nextMonth: Math.round(m[2] + growth), trend: growth > 0 ? 'up' : 'down' };",
        "outputs": [
          "output"
        ]
      },
      "position": {
        "x": 530,
        "y": 228
      }
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "Forecast",
      "category": "utility",
      "config": {
        "message": "Next month ≈ {{ $json.nextMonth }} ({{ $json.trend }})"
      },
      "position": {
        "x": 1060,
        "y": 228
      }
    },
    {
      "id": "py",
      "type": "utility.python",
      "label": "Original Python (unconverted)",
      "category": "script",
      "config": {
        "code": "m = input['months']\ngrowth = (m[-1] - m[0]) / 2\nreturn { 'nextMonth': round(m[-1] + growth), 'trend': 'up' if growth > 0 else 'down' }",
        "outputs": [
          "output"
        ]
      },
      "position": {
        "x": 0,
        "y": 0
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "project",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "project",
      "sourcePort": "output",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "The Python node is the landing pad for IMPORTED Python steps (e.g. from n8n): it holds the code faithfully but the engine has no Python runtime yet — right-click offers a JavaScript conversion, which is exactly what the live lane here does. The original Python step is parked OFF the run path so the demo runs."
  }
}

Generated from the verified demo corpus — this exact document seeds and runs on a fresh Flowdrome. Raw JSON: forecast-python-imported.json.