{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "14400235-CB19-48B1-920B-D62BD6B542D0",
    "name": "xpost: new article shared to social"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a new article is published in WordPress, writes a caption that fits every chosen account's limits and options from Get Posting Rules, adds the featured image and queues the post in the next free xpost slot, then tells the editor in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a new article is published in WordPress, writes a caption that fits every chosen account and passes the project's guardrails, adds the featured image and queues the post in the next free xpost slot, then tells the editor in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the note for the editor Result"
          },
          "position": {
            "x": 434,
            "y": 389
          }
        },
        "flowElementId": "D5C02CC9-28AE-4061-8E46-10389011B337",
        "groupId": null,
        "id": "6E0066B6-AD2D-4341-8C6B-4044961C885A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "post",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Queued post",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "9545FF3D-9483-4D84-9E67-60B10DDBA4ED"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "caption",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Caption",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "caption",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A682BF4C-4A56-4733-B254-F97CCD1DC122"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Picked",
                    "subPathSegments": [
                      {
                        "key": "names",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "36CE2759-2A88-4339-BF3D-647D55114616"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "title",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Article",
                    "subPathSegments": [
                      {
                        "key": "title",
                        "optional": false
                      },
                      {
                        "key": "rendered",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "link",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Article",
                    "subPathSegments": [
                      {
                        "key": "link",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const decode = s => String(s || '').replace(/<[^>]*>/g, '').replace(/&#(\\d+);/g, (m, n) => String.fromCharCode(Number(n))).replace(/&amp;/g, '&').replace(/&quot;/g, '\"').trim();\nconst when = (iso, tz) => {\n  if (!iso) return 'as soon as it is approved in xpost';\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};\nconst article = `<${link}|${decode(title)}>`;\nconst lines = [\n  post && post.status === 'pending_approval' ? `*New article post is waiting for approval in xpost:* ${article}` : `*New article queued for social:* ${article}`,\n  `Accounts: ${accounts}`,\n  `Goes out: ${when(post && post.scheduled_at, post && post.timezone)}`,\n  `Caption: ${caption}`,\n  post && post.preview_url ? `<${post.preview_url}|Open the preview>` : null,\n  'To change or pull it, open the post in xpost before its slot.',\n].filter(Boolean);\nreturn { text: lines.join('\\n') };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Editor note",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the note for the editor",
        "nextElementIds": [
          "6FEA7A87-980A-48C7-A7DB-DA1FC9E1CEFC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the caption Result"
          },
          "tools": {
            "EXTENSION:::SHARED:::default:::xpost:::getPostingRules": {
              "elementId": "EXTENSION:::SHARED:::default:::xpost:::getPostingRules",
              "dynamicOptionsLabels": {}
            }
          },
          "position": {
            "x": 459,
            "y": 219
          }
        },
        "flowElementId": "D2B328F7-E997-492A-8E66-7DB046BC4BBB",
        "groupId": null,
        "id": "A682BF4C-4A56-4733-B254-F97CCD1DC122",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Caption",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You write the social post that announces a new article from our blog. xpost sends it to the accounts listed, as one caption shared by every account.\n\nFirst call Get Posting Rules for the listed account IDs and read each account's caption limit and options. Write one caption that fits the smallest caption limit among them, counting the article link, which goes at the end. Lead with what the reader gets from the article, in plain words. Use at most two hashtags, and only when they help. No emojis unless the article title uses them.\n\nFor a Pinterest account, its options list the boards: pick the board that fits the article best. Set only options and values that Get Posting Rules lists for that account.\n\nReply with JSON only, with these fields:\ncaption: the final caption, link included\nnetworkOptions: an object of the network options you set, keyed by network (for example pinterest), or an empty object when you set none"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [
            {
              "connectionId": null,
              "definition": {},
              "enabled": true,
              "hostType": "SHARED",
              "methodName": "getPostingRules",
              "name": "Get Posting Rules",
              "notes": "Returns, per account, everything a post to it may carry: limits, capabilities and every network option it accepts in Network Options, with allowed values. Pinterest accounts also list their boards.",
              "packageId": "default",
              "params": [],
              "serviceId": "xpost",
              "type": "FR_FUNCTION"
            }
          ],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Article title: "
              },
              {
                "id": "RESULT",
                "label": "Article",
                "subPathSegments": [
                  {
                    "key": "title",
                    "optional": false
                  },
                  {
                    "key": "rendered",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nLink: "
              },
              {
                "id": "RESULT",
                "label": "Article",
                "subPathSegments": [
                  {
                    "key": "link",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nExcerpt: "
              },
              {
                "id": "RESULT",
                "label": "Article",
                "subPathSegments": [
                  {
                    "key": "excerpt",
                    "optional": false
                  },
                  {
                    "key": "rendered",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nAccounts (ID, then reference):\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Picked",
                "subPathSegments": [
                  {
                    "key": "forAgent",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "36CE2759-2A88-4339-BF3D-647D55114616"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Write the caption",
        "nextElementIds": [
          "7F850D6B-5B82-432A-85B7-B99762368D67"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "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": "Queue the post in xpost Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::createPost",
          "legacyElementId": null,
          "methodName": "createPost",
          "position": {
            "x": 110,
            "y": 380
          }
        },
        "flowElementId": "9654856E-EA33-423E-86D9-1A52D6820052",
        "groupId": null,
        "id": "9545FF3D-9483-4D84-9E67-60B10DDBA4ED",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "socialAccounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Picked",
                    "subPathSegments": [
                      {
                        "key": "refs",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "36CE2759-2A88-4339-BF3D-647D55114616"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "caption",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Caption",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "caption",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A682BF4C-4A56-4733-B254-F97CCD1DC122"
                  }
                ],
                "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": "7F850D6B-5B82-432A-85B7-B99762368D67"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scheduledAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Post parts",
                    "subPathSegments": [
                      {
                        "key": "publishAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7F850D6B-5B82-432A-85B7-B99762368D67"
                  }
                ],
                "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": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Caption",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "networkOptions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A682BF4C-4A56-4733-B254-F97CCD1DC122"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "idempotencyKey",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "wordpress-article-"
                  },
                  {
                    "id": "RESULT",
                    "label": "Article",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
                  }
                ],
                "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": null,
          "packageId": "default",
          "resultAlias": "Queued post",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "xpost",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Queue the post in xpost",
        "nextElementIds": [
          "6E0066B6-AD2D-4341-8C6B-4044961C885A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a new post is published on the WordPress site. Optionally filter by category to react only to posts in a specific topic. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::wordpress:::onNewPublishedPost",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::wordpress:::onNewPublishedPost",
          "newElementId": "EXTENSION:::SHARED:::default:::wordpress:::onNewPublishedPost",
          "legacyElementId": "JS###v1###WordPress###onNewPublishedPost",
          "methodName": "onNewPublishedPost",
          "position": {
            "x": 117,
            "y": 40
          }
        },
        "flowElementId": "0D5C85EA-1C0B-444F-A3F3-E5A58E5D9B30",
        "groupId": null,
        "id": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewPublishedPost",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Article",
          "serviceId": "wordpress",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New article published",
        "nextElementIds": [
          "30E1DEAC-8F8C-4F33-AEC5-0723C3ACE9F0"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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": 785,
            "y": 210
          }
        },
        "flowElementId": "C2B2A801-D415-42B2-8724-8A256078F77A",
        "groupId": null,
        "id": "5FD522B5-0CA2-48D5-A645-CED1DB60B179",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "url",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Featured image",
                    "subPathSegments": [
                      {
                        "key": "source_url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E57A7FBB-2073-4FB2-9ADD-DA787CB35D65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "altText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Featured image",
                    "subPathSegments": [
                      {
                        "key": "alt_text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E57A7FBB-2073-4FB2-9ADD-DA787CB35D65"
                  }
                ],
                "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": [
          "A682BF4C-4A56-4733-B254-F97CCD1DC122"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the editor in Slack Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 788,
            "y": 380
          }
        },
        "flowElementId": "590122B4-B516-4F3E-BF02-FC04E4DA0C6B",
        "groupId": null,
        "id": "6FEA7A87-980A-48C7-A7DB-DA1FC9E1CEFC",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Editor note",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6E0066B6-AD2D-4341-8C6B-4044961C885A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Editor message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the editor in Slack",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1110,
            "y": 49
          }
        },
        "flowElementId": "13531370-DEB0-462F-8C6C-9B5006D6817C",
        "groupId": null,
        "id": "7A56DA89-222E-4825-B1CC-DB5589B96AF1",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "b60b4fd5-4390-445c-82e0-5f4db5536abe",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Article",
                      "subPathSegments": [
                        {
                          "key": "featured_media",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "INT",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 0
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "b60b4fd5-4390-445c-82e0-5f4db5536abe"
            ]
          },
          "elseComponent": {
            "componentId": "A682BF4C-4A56-4733-B254-F97CCD1DC122",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has image",
          "storeResult": false,
          "thenComponent": {
            "componentId": "E57A7FBB-2073-4FB2-9ADD-DA787CB35D65",
            "componentType": "ELEMENT"
          }
        },
        "name": "Article has an image?",
        "nextElementIds": [
          "E57A7FBB-2073-4FB2-9ADD-DA787CB35D65",
          "A682BF4C-4A56-4733-B254-F97CCD1DC122"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Fetches a single media library item by numeric ID, including source URL, mime type, alt text, caption, and rendered metadata.",
          "elementId": "EXTENSION:::SHARED:::default:::wordpress:::getMedia",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the featured image Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::wordpress:::getMedia",
          "legacyElementId": "JS###v1###WordPress###getMedia",
          "methodName": "getMedia",
          "position": {
            "x": 1104,
            "y": 210
          }
        },
        "flowElementId": "B648B075-35C4-4206-9415-F4F6C5026740",
        "groupId": null,
        "id": "E57A7FBB-2073-4FB2-9ADD-DA787CB35D65",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "mediaId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Article",
                    "subPathSegments": [
                      {
                        "key": "featured_media",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F"
                  }
                ],
                "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": "getMedia",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Featured image",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "wordpress",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the featured image",
        "nextElementIds": [
          "5FD522B5-0CA2-48D5-A645-CED1DB60B179"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "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 accounts to post to Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::xpost:::listSocialAccounts",
          "legacyElementId": null,
          "methodName": "listSocialAccounts",
          "position": {
            "x": 433,
            "y": 40
          }
        },
        "flowElementId": "2A3BAE91-467B-4B3C-9818-7AEBD5021BB9",
        "groupId": null,
        "id": "30E1DEAC-8F8C-4F33-AEC5-0723C3ACE9F0",
        "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 accounts to post to",
        "nextElementIds": [
          "36CE2759-2A88-4339-BF3D-647D55114616"
        ],
        "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": 122,
            "y": 219
          }
        },
        "flowElementId": "02FACB0C-5400-4151-9DEA-AE12D8490F55",
        "groupId": null,
        "id": "7F850D6B-5B82-432A-85B7-B99762368D67",
        "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": "5FD522B5-0CA2-48D5-A645-CED1DB60B179"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "return {\n  mediaIds: imageId ? [String(imageId)] : [],\n  publishAt: 'next_slot',\n};"
              }
            ],
            "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": [
          "9545FF3D-9483-4D84-9E67-60B10DDBA4ED"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the accounts Result"
          },
          "position": {
            "x": 795,
            "y": 49
          }
        },
        "flowElementId": "D40B8709-2E62-449C-A9D4-61E786074288",
        "groupId": null,
        "id": "36CE2759-2A88-4339-BF3D-647D55114616",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Accounts",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "30E1DEAC-8F8C-4F33-AEC5-0723C3ACE9F0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "networks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Networks",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Networks"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const rows = Array.isArray(accounts) ? accounts : (accounts && Array.isArray(accounts.data) ? accounts.data : []);\nconst wanted = String(networks || '').toLowerCase().split(/[\\s,;]+/).filter(Boolean);\nconst labels = { x: 'X', instagram: 'Instagram', facebook: 'Facebook', threads: 'Threads', pinterest: 'Pinterest', tiktok: 'TikTok', youtube: 'YouTube', linkedin: 'LinkedIn', bluesky: 'Bluesky' };\nconst broken = /reconnect|disconnect|expire|error|revoke|invalid/i;\nconst picked = rows.filter(a => wanted.includes(String(a.platform || '').toLowerCase()) && !broken.test(String(a.status || '')));\nconst ref = a => a.ref || `${a.platform}:${a.username}`;\nreturn {\n  refs: picked.map(ref),\n  ids: picked.map(a => a.id),\n  forAgent: picked.map(a => `${a.id} (${ref(a)})`).join('\\n'),\n  names: picked.map(a => `${labels[a.platform] || a.platform} @${a.username}`).join(', '),\n  count: picked.length,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Picked",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the accounts",
        "nextElementIds": [
          "7A56DA89-222E-4825-B1CC-DB5589B96AF1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "DE6F1072-1E98-4E3A-A8C0-558CFF7D014F",
    "groups": [],
    "id": "00B8A999-3EFA-4943-872D-FFADB1768C5A",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "The Anthropic key the caption writer uses.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The networks new articles are shared to, separated by commas. Every connected xpost account on these networks gets the post.",
          "error": null,
          "name": "Networks",
          "type": "STRING",
          "value": ""
        }
      ],
      "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-03T01:33:35.248Z"
}
