{
  "name": "Securely call Google Cloud Run APIs with service account auth (main-workflow)",
  "nodes": [
    {
      "id": "1003f9f2-98a2-4690-bc36-dec428c71e46",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        224
      ],
      "parameters": {
        "width": 512,
        "height": 480,
        "content": "# Running the Workflow\n\n## Run it\n- Click **Execute** (or **Execute workflow**).\n- Make sure `service_url` and option `service_path` is set.\n\n## What happens\n- Calls the **Service Auth (sub-workflow)*"
      }
    },
    {
      "id": "c06b15b6-7619-4b5e-a2d6-cd7b3b4f5a91",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        576
      ],
      "parameters": {
        "width": 432,
        "height": 336,
        "content": "## Extra Configurations for Workflow\n### Google Credentials (Service Account)\n- Open a **Google** node → **Create New Credential**\n- **Authentication:** Service Account\n- **Service account email:** `c"
      }
    },
    {
      "id": "8da22b71-e554-4d44-91c6-e6e2a2c4adeb",
      "name": "Check Auth",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1920,
        352
      ]
    },
    {
      "id": "ab91bde5-4063-40eb-a096-2cbfbbb853c7",
      "name": "Execute",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        464,
        256
      ]
    },
    {
      "id": "e5b5ae39-5420-4c34-9631-1135a1c7aee3",
      "name": "Collect Context Example",
      "type": "n8n-nodes-base.merge",
      "position": [
        1184,
        256
      ]
    },
    {
      "id": "ea8eeea6-463a-4278-a45c-ab8c36c4ce78",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        224
      ],
      "parameters": {
        "width": 224,
        "height": 432,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Merge node — gathers all context.\n\nUse a **Merge** node to add the auth context (`id_token`) to items.\n\n- **Mode:** `Combine`\n- **Combine By:** `All Possible Combinations`"
      }
    },
    {
      "id": "1df841ed-f332-4760-8d14-7afd658b8b0f",
      "name": "Set Example Context Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        928,
        352
      ]
    },
    {
      "id": "643a2331-8643-4fca-8582-e3ec006469d0",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1472,
        256
      ]
    },
    {
      "id": "86d0adfc-a48e-4649-b659-f3caf27d75cc",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        16
      ],
      "parameters": {
        "width": 224,
        "height": 384,
        "content": "### Split Out node — iterate array, keep context\n- **Operation:** Split Out Items\n- **Field to split:** `<your_array_field>`\n- **Include:** **All other fields** (keeps `id_token`, `service_url`, etc.)"
      }
    },
    {
      "id": "fc6c3e1f-dd75-4ded-aede-debe8e5b1d6e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        336
      ],
      "parameters": {
        "width": 336,
        "height": null,
        "content": "#### Point to Service Auth\n#### (sub-workflow)\n\n###### If you are lost\n###### read my Medium article\n###### linked in the main sticky note"
      }
    },
    {
      "id": "191ec402-a438-4a20-a39c-73e4c78350e6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        80
      ],
      "parameters": {
        "width": 166,
        "height": 224,
        "content": "###### Point To\n\n###### Service Auth \n###### (sub-workflow)\n\n"
      }
    },
    {
      "id": "da178c80-a687-45cf-9d78-f8f3b877962e",
      "name": "Get Auth",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        928,
        176
      ]
    },
    {
      "id": "74dee137-1db5-4884-a7da-5f52d88dbaac",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 672,
        "height": 208,
        "content": "## Required Setup — Google Cloud Run & Service Account\n### You’ll need to:\n- **Configure a Google Cloud Run service** (set **Require authentication**).\n- **Create a Google Service Account** and grant "
      }
    },
    {
      "id": "6e7dd64a-0623-4f85-a15f-d963295d9c59",
      "name": "Cloud Run Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2128,
        480
      ]
    },
    {
      "id": "0a8b37cb-d0a0-4cb1-9e58-bea8adee5cb1",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1728,
        176
      ]
    },
    {
      "id": "bdcd0698-6749-4216-be57-c1589585da8c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        16
      ],
      "parameters": {
        "width": 166,
        "height": 288,
        "content": "#### Var Config\n- **service_url** - base url to cloud run service\n- **service_path** - (optional) page path"
      }
    },
    {
      "id": "ffa80822-56aa-43f4-8da9-35c455024f5c",
      "name": "Vars",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        176
      ]
    },
    {
      "id": "8e09bb36-88f4-41fb-b0d7-e911f513f798",
      "name": "Done",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1920,
        112
      ]
    }
  ],
  "connections": {
    "Vars": {
      "main": [
        [
          {
            "node": "Get Auth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute": {
      "main": [
        [
          {
            "node": "Set Example Context Fields",
            "type": "main",
            "index": 0
          },
          {
            "node": "Vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Auth": {
      "main": [
        [
          {
            "node": "Collect Context Example",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Auth": {
      "main": [
        [
          {
            "node": "Cloud Run Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check Auth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cloud Run Request": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Context Example": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Example Context Fields": {
      "main": [
        [
          {
            "node": "Collect Context Example",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}