{
  "name": "ApexApi \u2014 Output Format compare (Text vs JSON vs JSON Schema)",
  "nodes": [
    {
      "parameters": {
        "content": "# \ud83e\uddea ApexApi \u2014 Output Format demo\n\nThe ApexApi **Chat** node can shape its answer three ways. All three nodes below send the **exact same prompt** \u2014 only the **Output Format** option differs \u2014 so you can see how the response changes.\n\n### How to run\n1. Open each ApexApi node \u2192 pick your **ApexApi account** credential (free key at **apexapi.dev**).\n2. Click **Test workflow** (bottom bar).\n3. Click each node and open its **OUTPUT** tab to compare the three results.\n\n_All three use `openai/gpt-4o-mini` \u2014 change the **Model** dropdown to try any of 129 models (OpenAI, Anthropic, Google, Bedrock, \u2026)._\n\nDocs: https://apexapi.dev/?ref=n8n-output-format-compare \u00b7 node `n8n-nodes-apexapi`",
        "height": 320,
        "width": 460,
        "color": 7
      },
      "id": "sticky-intro",
      "name": "Start here",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        120,
        80
      ]
    },
    {
      "parameters": {},
      "id": "trigger-1",
      "name": "When clicking Test",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        200,
        480
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "message",
        "model": "openai/gpt-4o-mini",
        "prompt": "Extract the product name, price (a number) and whether it is in stock from this text:\n\n\"The Acme Widget costs $19.99 and is currently in stock.\"",
        "options": {
          "outputFormat": "text"
        }
      },
      "id": "apex-text",
      "name": "1 \u00b7 Text",
      "type": "n8n-nodes-apexapi.apexApi",
      "typeVersion": 1,
      "position": [
        640,
        300
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000,
      "credentials": {
        "apexApiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "### 1 \u00b7 Text  (default)\n\nA normal, human-readable answer.\n\n**Output looks like:**\n```\nProduct Name: Acme Widget\nPrice: 19.99\nIn Stock: Yes\n```\n\n\u26a0\ufe0f You'd have to parse this yourself downstream. Best for chat replies, summaries, captions.",
        "height": 280,
        "width": 360,
        "color": 5
      },
      "id": "sticky-text",
      "name": "About: Text",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1040,
        200
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "message",
        "model": "openai/gpt-4o-mini",
        "prompt": "Extract the product name, price (a number) and whether it is in stock from this text:\n\n\"The Acme Widget costs $19.99 and is currently in stock.\"",
        "options": {
          "outputFormat": "json_object"
        }
      },
      "id": "apex-json",
      "name": "2 \u00b7 JSON",
      "type": "n8n-nodes-apexapi.apexApi",
      "typeVersion": 1,
      "position": [
        640,
        500
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000,
      "credentials": {
        "apexApiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "### 2 \u00b7 JSON\n\nForces a **valid JSON object** \u2014 no markdown fences, parses straight into the next node. But the **model chooses the field names** (they can vary run to run).\n\n**Output looks like:**\n```\n{\n  \"product_name\": \"Acme Widget\",\n  \"price\": 19.99,\n  \"in_stock\": true\n}\n```\n\nBest when you want clean JSON and you describe the fields in the prompt.",
        "height": 320,
        "width": 360,
        "color": 4
      },
      "id": "sticky-json",
      "name": "About: JSON",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1040,
        500
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "message",
        "model": "openai/gpt-4o-mini",
        "prompt": "Extract the product name, price (a number) and whether it is in stock from this text:\n\n\"The Acme Widget costs $19.99 and is currently in stock.\"",
        "options": {
          "outputFormat": "json_schema",
          "jsonSchema": "{\"type\":\"object\",\"properties\":{\"product\":{\"type\":\"string\"},\"price\":{\"type\":\"number\"},\"in_stock\":{\"type\":\"boolean\"}},\"required\":[\"product\",\"price\",\"in_stock\"],\"additionalProperties\":false}"
        }
      },
      "id": "apex-schema",
      "name": "3 \u00b7 JSON (Custom Schema)",
      "type": "n8n-nodes-apexapi.apexApi",
      "typeVersion": 1,
      "position": [
        640,
        760
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 2000,
      "credentials": {
        "apexApiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "### 3 \u00b7 JSON (Custom Schema)  \u2b50\n\nYou define the **exact shape** in the node's **JSON Schema** field \u2192 the model must return **your exact keys & types**, every time.\n\nSchema here asks for: `product`, `price`, `in_stock`.\n\n**Output looks like:**\n```\n{\"product\":\"Acme Widget\",\"price\":19.99,\"in_stock\":true}\n```\n\n\u2705 Note it returns **`product`**, not `product_name` like node 2 \u2014 the schema enforces it. Best when the next node needs predictable fields.\n\n_Works on OpenAI + OpenAI-compatible models (Bedrock, DeepSeek, Groq, Mistral). Claude-/Gemini-direct ignore it._",
        "height": 380,
        "width": 360,
        "color": 3
      },
      "id": "sticky-schema",
      "name": "About: JSON Schema",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1040,
        840
      ]
    }
  ],
  "connections": {
    "When clicking Test": {
      "main": [
        [
          {
            "node": "1 \u00b7 Text",
            "type": "main",
            "index": 0
          },
          {
            "node": "2 \u00b7 JSON",
            "type": "main",
            "index": 0
          },
          {
            "node": "3 \u00b7 JSON (Custom Schema)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "active": false
}