{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "C7D0572A-0458-4D03-A552-E4956DB2962F",
    "name": "Taplio: every published post logged in a sheet"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Checks Taplio on a schedule for posts that went live on the LinkedIn account, through Taplio or directly on LinkedIn, and adds one row per post to a Google Sheet: date, time, title, text, link, media and the Taplio post ID.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Checks Taplio on a schedule for posts that went live on the LinkedIn account, through Taplio or directly on LinkedIn, and adds a row for each one to a Google Sheet: date, text, link and media.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Shape the row Result"
          },
          "position": {
            "x": 410,
            "y": 49
          }
        },
        "flowElementId": "96AC5F8F-4A4C-4979-91CF-9619F228623E",
        "groupId": null,
        "id": "6C83D6BD-DB7C-4C7B-BB94-9862C915FE01",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "sentAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "sent_at",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "createdAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "created_at",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "content",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "content",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "url",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "media",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "media",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mediaType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "media_type",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "postId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Published post",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D5153FDA-D7CA-4E02-8C90-C11E8F843363"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const when = new Date(sentAt || createdAt || Date.now());\nconst pad = (n) => String(n).padStart(2, '0');\nconst date = `${when.getUTCFullYear()}-${pad(when.getUTCMonth() + 1)}-${pad(when.getUTCDate())}`;\nconst time = `${pad(when.getUTCHours())}:${pad(when.getUTCMinutes())}`;\nconst text = String(content || '').trim();\nconst firstLine = text.split('\\n').map(l => l.trim()).find(Boolean) || '';\nconst title = firstLine.length > 80 ? firstLine.slice(0, 77) + '...' : firstLine;\nconst files = Array.isArray(media) ? media.map(m => m && (m.url || m.id)).filter(Boolean) : [];\nreturn {\n  'Date': date,\n  'Time (UTC)': time,\n  'Title': title,\n  'Post': text,\n  'Link': url || '',\n  'Media': files.join(', '),\n  'Media type': mediaType || (files.length ? 'media' : 'text'),\n  'Taplio ID': postId || '',\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Sheet row",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Shape the row",
        "nextElementIds": [
          "347A7093-B6C9-4673-B394-DF20C2B40109"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds new data rows to Google Sheets for AI agents to store processed results, log user interactions, or collect data from automated workflows. Perfect for building databases, tracking metrics, saving form submissions, or creating data collection pipelines.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add the row to the log Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 710,
            "y": 40
          }
        },
        "flowElementId": "08FB8A36-BFC1-4C46-8684-55E1BE41BCB2",
        "groupId": null,
        "id": "347A7093-B6C9-4673-B394-DF20C2B40109",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Post log sheet",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Post log sheet"
                  }
                ],
                "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": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sheet row",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "6C83D6BD-DB7C-4C7B-BB94-9862C915FE01"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Add the row to the log', Error: The placeholder \"Post log sheet\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "addRow",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Logged row",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add the row to the log",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires for each post that goes live on the LinkedIn account, through Taplio or directly on LinkedIn. Watches posts created or published in the last 90 days.",
          "elementId": "EXTENSION:::SHARED:::default:::taplio:::onNewPublishedPost",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::taplio:::onNewPublishedPost",
          "newElementId": "EXTENSION:::SHARED:::default:::taplio:::onNewPublishedPost",
          "legacyElementId": null,
          "methodName": "onNewPublishedPost",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "C8DE19A5-D9C4-4554-A79D-16E92EFF32B5",
        "groupId": null,
        "id": "D5153FDA-D7CA-4E02-8C90-C11E8F843363",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewPublishedPost",
          "frequency": {
            "repeat": {
              "every": 3600
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Published post",
          "serviceId": "taplio",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New published post",
        "nextElementIds": [
          "6C83D6BD-DB7C-4C7B-BB94-9862C915FE01"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      }
    ],
    "firstElementId": "D5153FDA-D7CA-4E02-8C90-C11E8F843363",
    "groups": [],
    "id": "A337011A-11B4-4F07-AA38-81FB5E0D741B",
    "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": [
        {
          "description": "The URL or ID of the Google Sheet the posts are logged in. Its first tab needs these headers in row 1: Date, Time (UTC), Title, Post, Link, Media, Media type, Taplio ID.",
          "error": null,
          "name": "Post log sheet",
          "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-02T08:34:56.272Z"
}
