{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "87F86518-A2D2-463F-8B40-FF1C21847573",
    "name": "xpost: content calendar run from a spreadsheet"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Each new row in the content calendar sheet becomes a scheduled xpost post at the row's date and time in the project's time zone, with the row's image and networks. The post ID goes back to the row, or the reason it was not posted.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Each new row in the content calendar sheet becomes a scheduled xpost post at the row's date and time in the project's time zone, with the row's image and networks. The post ID goes back to the row, or the reason it was not posted.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Lists the project's connected accounts with their status, the reference to post to (ref), and what each connection can publish (limits and capabilities).",
          "elementId": "EXTENSION:::SHARED:::default:::xpost:::listSocialAccounts",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the connected accounts Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::listSocialAccounts",
          "legacyElementId": null,
          "methodName": "listSocialAccounts",
          "position": {
            "x": 847,
            "y": 40
          }
        },
        "flowElementId": "DE0AC504-3286-4904-BE4C-44E2C9EA5560",
        "groupId": null,
        "id": "0EBC0DEA-7EB8-405D-B7EE-269A1813755B",
        "metaInfo": {
          "bodyParams": [],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listSocialAccounts",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Accounts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xpost",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the connected accounts",
        "nextElementIds": [
          "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates existing data in Google Sheets for AI agents to modify records, correct information, or maintain data accuracy in automated workflows. Perfect for updating user profiles, adjusting scores, or maintaining dynamic data that changes over time.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the result to the row Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "legacyElementId": "JS###v1###GoogleSheets###updateRow",
          "methodName": "updateRow",
          "position": {
            "x": 857,
            "y": 380
          }
        },
        "flowElementId": "0B05D866-08AC-4FB2-B891-A8587659EEFD",
        "groupId": null,
        "id": "CE4BCC0B-AA9F-428E-BE5B-B7872A8AEB0B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Calendar row",
                    "subPathSegments": [
                      {
                        "key": "rowNumber",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "A8469CB5-BBFE-488D-9C8A-F1A3BC75BF8B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowData",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row update",
                    "subPathSegments": [
                      {
                        "key": "rowData",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3339BC41-962B-4D42-97D6-EE97469CB6BD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Write the result to the row', Error: Document is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "updateRow",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Row written",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Write the result to the row",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Gather the post Result"
          },
          "position": {
            "x": 151,
            "y": 219
          }
        },
        "flowElementId": "6B0FB826-F10D-47EC-92A8-F7D9C29CC3E7",
        "groupId": null,
        "id": "E6E40B34-6B7C-4A1D-A683-2901FA8C3EB0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "imageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "xpost image",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "54576F72-036A-4215-951E-246385C17FA4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "return { mediaIds: imageId ? [String(imageId)] : [] };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Post parts",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Gather the post",
        "nextElementIds": [
          "4F2863BB-FA47-4558-B9D3-F77F02DCCF26"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the row Result"
          },
          "position": {
            "x": 1205,
            "y": 49
          }
        },
        "flowElementId": "73E5967E-D90E-4A28-8404-F33BB996CDC7",
        "groupId": null,
        "id": "1F127D49-CBF6-4C99-8E85-AD7A4505B431",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Calendar row",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "A8469CB5-BBFE-488D-9C8A-F1A3BC75BF8B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Calendar row",
                    "subPathSegments": [
                      {
                        "key": "rowNumber",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "A8469CB5-BBFE-488D-9C8A-F1A3BC75BF8B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Accounts",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0EBC0DEA-7EB8-405D-B7EE-269A1813755B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "timezone",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Project",
                    "subPathSegments": [
                      {
                        "key": "timezone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8C490A23-6EDF-4B27-BCA0-C0792B96C03A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const data = row && typeof row === 'object' ? row : {};\nconst get = name => {\n  const key = Object.keys(data).find(k => k.trim().toLowerCase() === name.toLowerCase());\n  return key === undefined || data[key] == null ? '' : String(data[key]).trim();\n};\nconst list = Array.isArray(accounts) ? accounts : [];\nconst broken = /reconnect|disconnect|expire|error|revoke|invalid/i;\nconst healthy = list.filter(a => !broken.test(String(a.status || '')));\nconst ref = a => a.ref || `${a.platform}:${a.username}`;\nconst problems = [];\n\nconst caption = get('Caption');\nconst imageUrl = get('Image link');\nif (!caption && !imageUrl) problems.push('The row has no caption and no image.');\n\nconst aliases = { twitter: 'x', 'x.com': 'x', ig: 'instagram', fb: 'facebook', yt: 'youtube' };\nconst tokens = get('Networks').split(/[,;\\n]+/).map(t => t.trim().toLowerCase()).filter(Boolean);\nlet picked = [];\nif (!tokens.length) problems.push('The Networks column is empty.');\nfor (const token of tokens) {\n  if (token === 'all') { picked.push(...healthy); continue; }\n  const matches = token.includes(':')\n    ? healthy.filter(a => ref(a).toLowerCase() === token)\n    : healthy.filter(a => String(a.platform || '').toLowerCase() === (aliases[token.replace(/\\s+/g, '')] || token.replace(/\\s+/g, '')));\n  if (!matches.length) problems.push(`No connected account in xpost for ${token}.`);\n  picked.push(...matches);\n}\nconst refs = [...new Set(picked.map(ref))];\n\nconst zone = timezone || 'UTC';\nconst parse = s => {\n  let m = s.match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})[ T](\\d{1,2}):(\\d{2})(?::\\d{2})?\\s*([AaPp][Mm])?$/);\n  let y, mo, d, h, mi, ap;\n  if (m) { [, y, mo, d, h, mi, ap] = m; } else {\n    m = s.match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})[ ,]+(\\d{1,2}):(\\d{2})(?::\\d{2})?\\s*([AaPp][Mm])?$/);\n    if (!m) return null;\n    [, mo, d, y, h, mi, ap] = m;\n  }\n  h = Number(h);\n  if (ap) { const pm = /p/i.test(ap); h = h === 12 ? (pm ? 12 : 0) : (pm ? h + 12 : h); }\n  return { y: Number(y), mo: Number(mo), d: Number(d), h, mi: Number(mi) };\n};\nconst offset = t => {\n  const parts = new Intl.DateTimeFormat('en-US', { timeZone: zone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }).formatToParts(new Date(t));\n  const v = k => Number(parts.find(x => x.type === k).value);\n  return Date.UTC(v('year'), v('month') - 1, v('day'), v('hour'), v('minute'), v('second')) - t;\n};\nlet publishAt = 'next_slot';\nconst when = get('Publish at');\nif (when) {\n  const p = parse(when);\n  if (!p) {\n    problems.push(`Publish at \"${when}\" is not a date and time like 2026-12-08 09:00.`);\n  } else {\n    const guess = Date.UTC(p.y, p.mo - 1, p.d, p.h, p.mi);\n    let t = guess - offset(guess);\n    t = guess - offset(t);\n    if (t <= Date.now()) problems.push(`Publish at ${when} has already passed in ${zone}.`);\n    publishAt = new Date(t).toISOString();\n  }\n}\n\nconst key = `${caption}|${imageUrl}|${publishAt}|${refs.join(',')}`;\nlet hash = 0;\nfor (let i = 0; i < key.length; i++) hash = (hash * 31 + key.charCodeAt(i)) >>> 0;\n\nreturn {\n  ok: problems.length === 0,\n  problem: problems.join(' '),\n  caption,\n  imageUrl,\n  refs,\n  publishAt,\n  postKey: `calendar-row-${rowNumber}-${hash.toString(36)}`,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Row",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the row",
        "nextElementIds": [
          "45D17B0E-A470-4FEA-BB6F-8B72FE8E8F76"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Returns the rules the project applies: its time zone, approval mode (autopilot or copilot), signature, guardrails, today's post allowance and its posting queue with the next free slots.",
          "elementId": "EXTENSION:::SHARED:::default:::xpost:::getProject",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the project's time zone Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::getProject",
          "legacyElementId": null,
          "methodName": "getProject",
          "position": {
            "x": 491,
            "y": 40
          }
        },
        "flowElementId": "A5FEC0F8-4C4C-4A71-83B9-1BBA8471CEC3",
        "groupId": null,
        "id": "8C490A23-6EDF-4B27-BCA0-C0792B96C03A",
        "metaInfo": {
          "bodyParams": [],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getProject",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Project",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xpost",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the project's time zone",
        "nextElementIds": [
          "0EBC0DEA-7EB8-405D-B7EE-269A1813755B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 876,
            "y": 219
          }
        },
        "flowElementId": "078865F4-BF02-4C11-9C46-CE824D2FED7B",
        "groupId": null,
        "id": "2884F330-E9F4-411D-B778-848A6E540EE9",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "82620cdd-b296-4aa1-9d29-cc7d160c98e2",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Row",
                      "subPathSegments": [
                        {
                          "key": "imageUrl",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "82620cdd-b296-4aa1-9d29-cc7d160c98e2"
            ]
          },
          "elseComponent": {
            "componentId": "E6E40B34-6B7C-4A1D-A683-2901FA8C3EB0",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has image",
          "storeResult": false,
          "thenComponent": {
            "componentId": "54576F72-036A-4215-951E-246385C17FA4",
            "componentType": "ELEMENT"
          }
        },
        "name": "Image on the row?",
        "nextElementIds": [
          "E6E40B34-6B7C-4A1D-A683-2901FA8C3EB0",
          "54576F72-036A-4215-951E-246385C17FA4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "xpost refused the post Result"
          },
          "position": {
            "x": 512,
            "y": 519
          }
        },
        "flowElementId": "7F2B5F08-BA5A-40D6-BBCB-1C1A3E943359",
        "groupId": null,
        "id": "631A2C31-6B98-4FFD-9E37-750A93A820C0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Refused",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "xpost refused the post",
        "nextElementIds": [
          "3339BC41-962B-4D42-97D6-EE97469CB6BD"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1205,
            "y": 219
          }
        },
        "flowElementId": "CB005EF4-639D-4E2E-A9D2-60985DF528E7",
        "groupId": null,
        "id": "45D17B0E-A470-4FEA-BB6F-8B72FE8E8F76",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "b74ea268-0298-4a51-b6f5-fae38d35c410",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Row",
                      "subPathSegments": [
                        {
                          "key": "ok",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "b74ea268-0298-4a51-b6f5-fae38d35c410"
            ]
          },
          "elseComponent": {
            "componentId": "3339BC41-962B-4D42-97D6-EE97469CB6BD",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Ready",
          "storeResult": false,
          "thenComponent": {
            "componentId": "2884F330-E9F4-411D-B778-848A6E540EE9",
            "componentType": "ELEMENT"
          }
        },
        "name": "Row ready to post?",
        "nextElementIds": [
          "2884F330-E9F4-411D-B778-848A6E540EE9",
          "3339BC41-962B-4D42-97D6-EE97469CB6BD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a post for one or more connected accounts. Creating a post sends it: it goes out now, at the chosen time or in the next free queue slot. In copilot mode it is held for approval instead (status pending_approval), which is success, not an error. Guardrail blocks fail with the violations.",
          "elementId": "EXTENSION:::SHARED:::default:::xpost:::createPost",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Schedule the post in xpost Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::createPost",
          "legacyElementId": null,
          "methodName": "createPost",
          "position": {
            "x": 130,
            "y": 380
          }
        },
        "flowElementId": "26F630B0-528D-43C8-ABC6-F8B1CB58AC60",
        "groupId": null,
        "id": "4F2863BB-FA47-4558-B9D3-F77F02DCCF26",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "socialAccounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "refs",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "caption",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "caption",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mediaIds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Post parts",
                    "subPathSegments": [
                      {
                        "key": "mediaIds",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E6E40B34-6B7C-4A1D-A683-2901FA8C3EB0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scheduledAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "publishAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "isDraft",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "platformConfigurations",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "idempotencyKey",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "postKey",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createPost",
          "onFailElemId": "631A2C31-6B98-4FFD-9E37-750A93A820C0",
          "packageId": "default",
          "resultAlias": "Scheduled post",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xpost",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Schedule the post in xpost",
        "nextElementIds": [
          "3339BC41-962B-4D42-97D6-EE97469CB6BD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Monitors Google Sheets for new rows and triggers AI workflows when data is added. Perfect for automated processing of form submissions, real-time data analysis, or immediate response to user input in collaborative spreadsheets. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::onNewRow",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::google-sheets:::onNewRow",
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::onNewRow",
          "legacyElementId": "JS###v1###GoogleSheets###onNewRow",
          "methodName": "onNewRow",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "85A9136C-31C1-4753-A30D-1E437EE884B2",
        "groupId": null,
        "id": "A8469CB5-BBFE-488D-9C8A-F1A3BC75BF8B",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New row in the content calendar', Error: Document is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewRow",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Calendar row",
          "serviceId": "google-sheets",
          "slaConditions": [],
          "staticData": {
            "sheetId": 0
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New row in the content calendar",
        "nextElementIds": [
          "8C490A23-6EDF-4B27-BCA0-C0792B96C03A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Prepare the row update Result"
          },
          "position": {
            "x": 508,
            "y": 389
          }
        },
        "flowElementId": "11BD58A6-1689-4E2C-930F-4852F2A63329",
        "groupId": null,
        "id": "3339BC41-962B-4D42-97D6-EE97469CB6BD",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "post",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Scheduled post",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "4F2863BB-FA47-4558-B9D3-F77F02DCCF26"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "refused",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Refused",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "631A2C31-6B98-4FFD-9E37-750A93A820C0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "problem",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "problem",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const when = (iso, tz) => {\n  try {\n    return new Intl.DateTimeFormat('en-US', { timeZone: tz || 'UTC', weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZoneName: 'short' }).format(new Date(iso));\n  } catch (e) {\n    return iso;\n  }\n};\nif (post && post.id) {\n  const status = post.status === 'pending_approval' ? 'Waiting for approval' : post.status === 'posted' ? 'Posted' : 'Scheduled';\n  return {\n    rowData: {\n      Status: status,\n      'xpost post ID': post.id,\n      Note: post.scheduled_at ? `Goes out ${when(post.scheduled_at, post.timezone)}` : String(post.message || ''),\n    },\n  };\n}\nreturn {\n  rowData: {\n    Status: 'Not posted',\n    Note: refused ? String(refused) : String(problem || 'Not posted.'),\n  },\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Row update",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Prepare the row update",
        "nextElementIds": [
          "CE4BCC0B-AA9F-428E-BE5B-B7872A8AEB0B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds an image, video or PDF to the media library from a public https link (up to 100 MB) and returns its ID for Create Post. A PDF is a LinkedIn document post, attached on its own.",
          "elementId": "EXTENSION:::SHARED:::default:::xpost:::uploadMediaFromUrl",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add the image to xpost Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::uploadMediaFromUrl",
          "legacyElementId": null,
          "methodName": "uploadMediaFromUrl",
          "position": {
            "x": 510,
            "y": 210
          }
        },
        "flowElementId": "CCFBC618-9A24-4FC9-8508-8D52411F9054",
        "groupId": null,
        "id": "54576F72-036A-4215-951E-246385C17FA4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "url",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Row",
                    "subPathSegments": [
                      {
                        "key": "imageUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1F127D49-CBF6-4C99-8E85-AD7A4505B431"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "altText",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "thumbnailTimestampMs",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "coverMediaId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "peopleTags",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "uploadMediaFromUrl",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "xpost image",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xpost",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add the image to xpost",
        "nextElementIds": [
          "E6E40B34-6B7C-4A1D-A683-2901FA8C3EB0"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "A8469CB5-BBFE-488D-9C8A-F1A3BC75BF8B",
    "groups": [],
    "id": "AE19EA24-FF50-4DF6-B9A9-50EBD6A903F3",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-12-02T01:41:47.312Z"
}
