{
  "id": "muWcdabaY0aYyjIx",
  "name": "Monday.com Board Groups Batch Processor with Sub-Workflow Delegation",
  "tags": [],
  "nodes": [
    {
      "id": "ba5a6c18-c844-41c8-bf66-c8dcb5800ce5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        80
      ],
      "parameters": {
        "width": 480,
        "height": 896,
        "content": "## Monday.com Board Groups Batch Processor with Sub-Workflow Delegation\n\n### How it works\n\n1. The workflow is triggered manually to begin processing boards in Monday.com.\n2. It fetches all boards from the Monday.com account.\n3. Each board is processed to fetch its groups and send context to a sub-workflow.\n4. Results from the sub-workflow are combined and used to manage group data.\n5. A secondary workflow processes individual groups and syncs task data to Airtable.\n\n### Setup steps\n\n- [ ] Set up Monday.com API credentials for fetching boards and groups.\n- [ ] Configure Airtable credentials for syncing data.\n- [ ] Define the parameters for the sub-workflow delegation.\n\n### Customization\n\nCustomize the Airtable fields to match your data structure."
      },
      "typeVersion": 1
    },
    {
      "id": "fa1f775e-e95c-4021-a03d-0dd3fb00780c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        256
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 304,
        "content": "## Start workflow\n\nManual trigger to initiate the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "1c1283d0-92a0-413e-8a87-5bb98d47acc5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 1088,
        "height": 544,
        "content": "## Fetch boards and process\n\nFetches all boards and processes each one for groups and tasks."
      },
      "typeVersion": 1
    },
    {
      "id": "04079e36-c7c6-4da8-b110-2a26346efaa6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        912
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 304,
        "content": "## Receive and extract groups\n\nHandles the reception of groups from the parent workflow and prepares them for processing."
      },
      "typeVersion": 1
    },
    {
      "id": "d516168d-0af6-431f-b1c1-b41e7b3f11c0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        736
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 464,
        "content": "## Process tasks in groups\n\nIterates through groups and handles tasks, including formatting and syncing data."
      },
      "typeVersion": 1
    },
    {
      "id": "2223708c-a316-443a-94cf-7b77e156a401",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        240,
        384
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6434349e-6859-4297-827f-9815df74bc09",
      "name": "Fetch All Boards",
      "type": "n8n-nodes-base.mondayCom",
      "position": [
        512,
        384
      ],
      "parameters": {
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "mondayComApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "027672cf-c5e3-4590-b13c-36b31abe6375",
      "name": "Combine All Results",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        192
      ],
      "parameters": {
        "jsCode": "// Get all results from the sub-workflow executions\nconst allResults = $input.all();\n\n// Combine all results into a single array\nconst combined = allResults.map(item => item.json);\n\nreturn [{ json: { \n  totalBoards: combined.length,\n  results: combined \n} }];"
      },
      "typeVersion": 2
    },
    {
      "id": "10581292-3e23-4be1-8b5b-58966466dcb3",
      "name": "Fetch Groups for Board",
      "type": "n8n-nodes-base.mondayCom",
      "position": [
        960,
        384
      ],
      "parameters": {
        "boardId": "={{ $json.id }}",
        "resource": "boardGroup",
        "operation": "getAll"
      },
      "credentials": {
        "mondayComApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c9009231-14dd-4a8b-8444-e9e7c371fd3c",
      "name": "Add Board Context to Groups",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        384
      ],
      "parameters": {
        "jsCode": "// Get the board data from Process Each Board node\nconst boardData = $(\"Process Each Board\").item.json;\nconst boardId = boardData.id;\nconst boardName = boardData.name;\nconst boardDescription = boardData.description;\nconst boardState = boardData.state;\nconst boardFolderId = boardData.board_folder_id;\nconst boardKind = boardData.board_kind;\nconst boardOwners = boardData.owners;\n\n// Get all groups from the fetch groups node\nconst groups = $(\"Fetch Groups for Board\").all();\n\n// Enrich each group with complete board context\nconst enrichedGroups = groups.map(group => ({\n  ...group.json,\n  boardId: boardId,\n  boardName: boardName,\n  boardDescription: boardDescription,\n  boardState: boardState,\n  boardFolderId: boardFolderId,\n  boardKind: boardKind,\n  boardOwners: boardOwners\n}));\n\nreturn enrichedGroups.map(group => ({ json: group }));"
      },
      "typeVersion": 2
    },
    {
      "id": "f02c2d8a-e400-4adf-90dc-05ad86635cba",
      "name": "Send to Sub-workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1408,
        464
      ],
      "parameters": {
        "options": {
          "waitForSubWorkflow": true
        },
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "muWcdabaY0aYyjIx",
          "cachedResultUrl": "/workflow/muWcdabaY0aYyjIx",
          "cachedResultName": "Monday.com Board Groups Batch Processor with Sub-Workflow Delegation"
        },
        "workflowInputs": {
          "value": {
            "groups": "={{ $(\"Add Board Context to Groups\").all() }}",
            "boardId": "={{ $(\"Process Each Board\").item.json.id }}",
            "boardname": "={{ $(\"Process Each Board\").item.json.name }}"
          },
          "schema": [
            {
              "id": "groups",
              "type": "array",
              "display": true,
              "required": false,
              "displayName": "groups",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "boardId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "boardId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "boardname",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "boardname",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c500a35a-6023-4974-a445-31284ad42c85",
      "name": "Process Each Board",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        736,
        384
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "f7268741-2cc9-4b89-89c7-71e07972cc11",
      "name": "Receive Groups from Parent",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        304,
        1040
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "groups",
              "type": "array"
            },
            {
              "name": "boardId"
            },
            {
              "name": "boardname"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f4dc0de8-c5a9-4609-993f-bf37767234ed",
      "name": "Loop Over Groups",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        752,
        1040
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "b44e6040-21a1-4514-9af6-85ce19d29622",
      "name": "Extract Groups Array1",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        1040
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst output = [];\n\nfor (const item of items) {\n  const boardData = item.json;\n  const boardId = boardData.boardId;\n  const boardName = boardData.boardname || boardData.boardName;\n  const groups = boardData.groups || [];\n\n  for (const group of groups) {\n    const innerGroupJson = group.json || {};\n    output.push({\n      json: {\n        boardId: boardId,\n        boardName: boardName,\n        groupId: innerGroupJson.id || \"\",\n        groupTitle: innerGroupJson.title || \"\"\n      }\n    });\n  }\n}\n\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "72ddf57c-9c57-48b5-bac6-a8b870266703",
      "name": "Fetch Tasks from Group1",
      "type": "n8n-nodes-base.mondayCom",
      "position": [
        976,
        848
      ],
      "parameters": {
        "boardId": "={{ $json.boardId }}",
        "groupId": "={{ $json.groupId }}",
        "resource": "boardItem",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "mondayComApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7cc6d3f4-1945-4780-9ce1-6698ae116cc2",
      "name": "Format Task Data1",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        848
      ],
      "parameters": {
        "jsCode": "const tasks = $input.all();\nconst currentLoopGroup = $('Loop Over Groups').item.json;\n\n// Helper function to find column value by ID\nfunction getColumnValue(columnValues, columnId) {\n  const column = columnValues.find(col => col.id === columnId);\n  return column ? column.text : null;\n}\n\nreturn tasks.map(task => {\n  const taskData = task.json;\n  const columnValues = taskData.column_values || [];\n  \n  return {\n    json: {\n      taskId: taskData.id || \"\",\n      taskName: taskData.name || \"\",\n      boardId: currentLoopGroup.boardId,\n      boardName: currentLoopGroup.boardName,\n      groupId: currentLoopGroup.groupId,\n      groupTitle: currentLoopGroup.groupTitle,\n      createdAt: taskData.created_at || \"\",\n      owner: getColumnValue(columnValues, \"person\"),\n      status: getColumnValue(columnValues, \"status\"),\n      type: getColumnValue(columnValues, \"Type\"),\n      storyPoints: getColumnValue(columnValues, \"Story Points\")\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "8bdd8b57-3ed9-4ca1-86b7-9e4167d02883",
      "name": "Sync to Airtable1",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1424,
        1024
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appWdMpb5e12ZB62P",
          "cachedResultUrl": "https://airtable.com/appWdMpb5e12ZB62P",
          "cachedResultName": "Prakash Project Tracker"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblrvvfU5HpymL71R",
          "cachedResultUrl": "https://airtable.com/appWdMpb5e12ZB62P/tblrvvfU5HpymL71R",
          "cachedResultName": "All Project Tasks"
        },
        "columns": {
          "value": {
            "Type": "={{ $json.type }}",
            "Owner": "={{ $json.owner }}",
            "Status": "={{ $json.status }}",
            "Project": "={{ $json.boardName }}",
            "Created At": "={{ $json.createdAt }}",
            "Group / Phase": "={{ $json.groupTitle }}",
            "Monday Task ID": "={{ $json.taskId }}",
            "Monday Task Name": "={{ $json.taskName }}",
            "Estimated Story Points": "={{ $json.storyPoints }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Monday Task ID",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Monday Task ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Project",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "GeoKey Project",
                  "value": "GeoKey Project"
                },
                {
                  "name": "OmniSync Platform",
                  "value": "OmniSync Platform"
                },
                {
                  "name": "Apex Mobile App",
                  "value": "Apex Mobile App"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Project",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Monday Task Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Monday Task Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Group / Phase",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Group / Phase",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created At",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Created At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "State",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "active",
                  "value": "active"
                },
                {
                  "name": "completed",
                  "value": "completed"
                },
                {
                  "name": "archived",
                  "value": "archived"
                },
                {
                  "name": "other",
                  "value": "other"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "State",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Owner",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Owner",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Not Started",
                  "value": "Not Started"
                },
                {
                  "name": "In Progress",
                  "value": "In Progress"
                },
                {
                  "name": "Ready to start",
                  "value": "Ready to start"
                },
                {
                  "name": "Stuck",
                  "value": "Stuck"
                },
                {
                  "name": "Completed",
                  "value": "Completed"
                },
                {
                  "name": "Other",
                  "value": "Other"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Bug",
                  "value": "Bug"
                },
                {
                  "name": "Feature",
                  "value": "Feature"
                },
                {
                  "name": "Task",
                  "value": "Task"
                },
                {
                  "name": "Test",
                  "value": "Test"
                },
                {
                  "name": "Epic",
                  "value": "Epic"
                },
                {
                  "name": "Story",
                  "value": "Story"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Estimated Story Points",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Estimated Story Points",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "GitHub Link",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "GitHub Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Epic",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Epic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sprint",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Sprint",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Active Sprint",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Active Sprint",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Monday Doc v2",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Monday Doc v2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Monday Task ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "typecast": true
        },
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "60abddc2-ab2f-40ad-a8fc-82796b83785c",
      "name": "Return to Parent1",
      "type": "n8n-nodes-base.code",
      "position": [
        976,
        1040
      ],
      "parameters": {
        "jsCode": "return [{ json: { status: \"success\", message: \"All groups processed\" } }];"
      },
      "typeVersion": 2
    }
  ],
  "active": true,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "f4e8f9ea-673e-4774-8449-370e3512cd16",
  "nodeGroups": [],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Fetch All Boards",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Boards": {
      "main": [
        [
          {
            "node": "Process Each Board",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Groups": {
      "main": [
        [
          {
            "node": "Return to Parent1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Tasks from Group1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Task Data1": {
      "main": [
        [
          {
            "node": "Sync to Airtable1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sync to Airtable1": {
      "main": [
        [
          {
            "node": "Loop Over Groups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Board": {
      "main": [
        [
          {
            "node": "Combine All Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Groups for Board",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send to Sub-workflow": {
      "main": [
        [
          {
            "node": "Process Each Board",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Groups Array1": {
      "main": [
        [
          {
            "node": "Loop Over Groups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Groups for Board": {
      "main": [
        [
          {
            "node": "Add Board Context to Groups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Tasks from Group1": {
      "main": [
        [
          {
            "node": "Format Task Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Groups from Parent": {
      "main": [
        [
          {
            "node": "Extract Groups Array1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Board Context to Groups": {
      "main": [
        [
          {
            "node": "Send to Sub-workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}