{
  "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."
  }
}