{
  "name": "Create sprint goals from Google Sheets with Pega Agile Studio and Google Gemini",
  "nodes": [
    {
      "id": "c3d5e4aa-94f7-49f8-b0bb-898f988ad975",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1360,
        544
      ]
    },
    {
      "id": "3c0ed479-2a2a-4f70-8268-4d02322d166d",
      "name": "Retrieve_Data_From_Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        720,
        320
      ]
    },
    {
      "id": "d24f1b08-2cfb-4906-95f7-e517c6d5dfc1",
      "name": "Retrieve Agile Studio US",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1696,
        544
      ]
    },
    {
      "id": "5d1f3240-4590-4df1-9db6-e26c457c946f",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        944,
        320
      ]
    },
    {
      "id": "4de6ab39-8e70-4e80-9cf2-5350b488edcd",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1888,
        320
      ]
    },
    {
      "id": "0199b4f9-5f45-4453-b6da-c729c3dd1cb1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        144
      ],
      "parameters": {
        "width": 336,
        "height": 800,
        "content": "## Create sprint goals using Pega Agile Studio with AI\nBased on the Google Sheet data, the AI will retrieve the userstories ID's, retrieves the userstory data and the corresponding attachments and cre"
      }
    },
    {
      "id": "4a284dcc-5185-4e3f-bb87-debaab06a161",
      "name": "Sprint Goal Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1360,
        320
      ]
    },
    {
      "id": "ded0900b-c824-4960-b9d2-4514d2870d4c",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        496,
        320
      ]
    },
    {
      "id": "ed5a1c26-7bdf-4107-a015-b6e0851e70da",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        320,
        1904
      ]
    },
    {
      "id": "8ec6fb9e-2dcb-48b7-a971-c8f0a24c98e9",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1248,
        1408
      ]
    },
    {
      "id": "1475c17f-fb96-47db-ad2f-343a465465b9",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1696,
        1504
      ]
    },
    {
      "id": "ab86e388-ccd2-4413-9eb0-f714872a53d9",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1920,
        1504
      ]
    },
    {
      "id": "ced10b8b-594f-4684-b299-aad76d3865e0",
      "name": "Merge the results",
      "type": "n8n-nodes-base.merge",
      "position": [
        2368,
        1408
      ]
    },
    {
      "id": "363e8b1a-89ca-40ab-9c18-15172df1ddaf",
      "name": "Convert to sheet data to readable format",
      "type": "n8n-nodes-base.code",
      "position": [
        2144,
        1312
      ]
    },
    {
      "id": "665b1a49-3605-449a-9acc-c5dae81e9957",
      "name": "Convert the xlsx data to more readable format",
      "type": "n8n-nodes-base.code",
      "position": [
        2144,
        1504
      ]
    },
    {
      "id": "74cda217-5fbc-4808-a339-c16dabd7ab3c",
      "name": "Keep only the attachment ID of .xlsx",
      "type": "n8n-nodes-base.set",
      "position": [
        1472,
        1504
      ]
    },
    {
      "id": "4e728863-0888-46c0-aa85-1a8cfa7f931d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        1136
      ],
      "parameters": {
        "width": null,
        "height": 432,
        "content": "## Native Sheets or .xlsx\nIf the attachment is a native Google Sheet, directly perform the API call.\n\nIf the file is a .xlsx file, download and extract the data and then return the values as the Googl"
      }
    },
    {
      "id": "703c715b-e4e6-47e3-a5fa-41023e09f18d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        1712
      ],
      "parameters": {
        "width": 272,
        "height": 480,
        "content": "## Subworkflow : \n* Retrieving Google Sheet attachments\nThis Sheets API call will retrieve all attachments that match 'spreadsheets' and get the data.\n\nThe Google API cannot process .xlsx files so a d"
      }
    },
    {
      "id": "c9dd2256-2021-42a9-9057-8617a4033847",
      "name": "Keep only the attachment ID of the Sheet",
      "type": "n8n-nodes-base.set",
      "position": [
        1696,
        1312
      ]
    },
    {
      "id": "4944021f-7422-4297-a7f5-fed0c08f603e",
      "name": "Only select specific spreadsheets",
      "type": "n8n-nodes-base.filter",
      "position": [
        1024,
        1408
      ]
    },
    {
      "id": "7cd22af0-af64-437c-9dca-de7b34803121",
      "name": "Only select specific document",
      "type": "n8n-nodes-base.filter",
      "position": [
        1008,
        1904
      ]
    },
    {
      "id": "cfb16248-ffba-46ad-a08a-723c0845be03",
      "name": "Only select specific presentation",
      "type": "n8n-nodes-base.filter",
      "position": [
        1008,
        2224
      ]
    },
    {
      "id": "157e6a8c-ca52-4b1f-86c2-a5eddf06f98c",
      "name": "Get the Userstory data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        1904
      ]
    },
    {
      "id": "6e167490-498f-4b43-9dd9-25c6dbd9e041",
      "name": "Iterate over the attachments",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        784,
        1904
      ]
    },
    {
      "id": "7d1f2b3e-4425-4929-a7fd-a13a19ae4f4b",
      "name": "Keep only the attachment ID of document",
      "type": "n8n-nodes-base.set",
      "position": [
        1232,
        1904
      ]
    },
    {
      "id": "50b38cca-29cf-43b8-830c-85f701b959d0",
      "name": "Keep only the attachment ID of presentation",
      "type": "n8n-nodes-base.set",
      "position": [
        1232,
        2224
      ]
    },
    {
      "id": "7cf5d996-ad55-4e8e-a338-06b9f65ae772",
      "name": "Perform the API request with the ID of document",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        1904
      ]
    },
    {
      "id": "6db3a7a5-c5d0-4341-9e94-eb008e8e4c71",
      "name": "Perform the API request with the ID of presentation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        2224
      ]
    },
    {
      "id": "0140946a-9909-4c13-8978-b06d047b5932",
      "name": "Convert the presentation to more readable format",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        2224
      ]
    },
    {
      "id": "3d7942ea-4643-4d45-8b2f-82c24320e366",
      "name": "Convert the document to more readable format",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        1904
      ]
    },
    {
      "id": "b951582a-778b-496b-84af-2d610445b8d3",
      "name": "Perform the API request with the ID of sheet",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        1312
      ]
    },
    {
      "id": "fdb496cd-3045-4166-851b-ca9b947a8404",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2592,
        1888
      ]
    },
    {
      "id": "c40bf273-0374-4633-b9d7-a9dbd05a404e",
      "name": "Call 'Get Attachments - Agile Studio US'",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1504,
        544
      ]
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Keep only the attachment ID of the Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Keep only the attachment ID of .xlsx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Sprint Goal Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Convert the xlsx data to more readable format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge the results": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sprint Goal Generator": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the Userstory data": {
      "main": [
        [
          {
            "node": "Iterate over the attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sprint Goal Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Agile Studio US": {
      "ai_tool": [
        [
          {
            "node": "Sprint Goal Generator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve_Data_From_Sheet": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Iterate over the attachments": {
      "main": [
        [
          {
            "node": "Only select specific document",
            "type": "main",
            "index": 0
          },
          {
            "node": "Only select specific spreadsheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Only select specific presentation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only select specific document": {
      "main": [
        [
          {
            "node": "Keep only the attachment ID of document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only select specific presentation": {
      "main": [
        [
          {
            "node": "Keep only the attachment ID of presentation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only select specific spreadsheets": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get the Userstory data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the attachment ID of .xlsx": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Retrieve_Data_From_Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the attachment ID of document": {
      "main": [
        [
          {
            "node": "Perform the API request with the ID of document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call 'Get Attachments - Agile Studio US'": {
      "ai_tool": [
        [
          {
            "node": "Sprint Goal Generator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Convert to sheet data to readable format": {
      "main": [
        [
          {
            "node": "Merge the results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the attachment ID of the Sheet": {
      "main": [
        [
          {
            "node": "Perform the API request with the ID of sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the attachment ID of presentation": {
      "main": [
        [
          {
            "node": "Perform the API request with the ID of presentation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert the document to more readable format": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Perform the API request with the ID of sheet": {
      "main": [
        [
          {
            "node": "Convert to sheet data to readable format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert the xlsx data to more readable format": {
      "main": [
        [
          {
            "node": "Merge the results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Perform the API request with the ID of document": {
      "main": [
        [
          {
            "node": "Convert the document to more readable format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert the presentation to more readable format": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Perform the API request with the ID of presentation": {
      "main": [
        [
          {
            "node": "Convert the presentation to more readable format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}