{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "A8CB99E1-F3D4-4805-B209-58DAD385114E",
    "name": "Fathom Analytics: release marked and measured"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -64.76190476190476,
        "y": -512.3809523809523,
        "zoom": 0.95
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a GitHub release is published, marks it as a milestone in Fathom Analytics. A week later, compares traffic and signups for the seven days before and after the release and posts the comparison on the release's Linear issue.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a GitHub release is published, marks it as a milestone in Fathom Analytics. A week later, compares traffic and signups for the seven days before and after the release and posts the comparison on the release's Linear issue.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Builds a custom report for one event of a site: conversions, unique conversions or value, as totals or grouped by date and by fields such as page, referrer or UTM campaign, filtered and sorted. Returns one object per row, with every number as text and value in cents.",
          "elementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getEventReport",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Signups the week after Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getEventReport",
          "legacyElementId": null,
          "methodName": "getEventReport",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "5EDD3B77-018E-4A78-87DB-E94F87D24206",
        "groupId": "35DE61D6-8202-4756-A310-659986F6777B",
        "id": "81E4A622-75AA-4219-BA4C-1E1FDD2719B3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Site ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Site ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "eventName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Signup event",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Signup event"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "aggregates",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "conversions"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "unique_conversions"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "dateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "afterFrom",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "afterTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateGrouping",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filters",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "desc"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Signups the week after', Error: The placeholder \"Site ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getEventReport",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Signups after",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fathom-analytics",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Signups the week after",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a milestone to a site, which marks an important date (a launch, a campaign) on its reports. Needs a token that can manage the site.",
          "elementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::createMilestone",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Mark the release on the graph Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::createMilestone",
          "legacyElementId": null,
          "methodName": "createMilestone",
          "position": {
            "x": 870,
            "y": 580
          }
        },
        "flowElementId": "18F10E42-47A5-4E35-AE06-7C944C976EF7",
        "groupId": null,
        "id": "A1F193FE-0C81-403F-B9D0-8898050497D7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Site ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Site ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "milestoneName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "milestoneDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "releaseDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Mark the release on the graph', Error: The placeholder \"Site ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createMilestone",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Milestone",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fathom-analytics",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Mark the release on the graph",
        "nextElementIds": [
          "8A58CDA8-7A63-4E3B-A015-3CC3712CB21E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single Linear issue by its ID (UUID) or identifier (e.g. ENG-42), including title, description, state, assignee, team, project, labels, and URL.",
          "elementId": "EXTENSION:::SHARED:::default:::linear:::getIssue",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the release's issue in Linear Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::linear:::getIssue",
          "legacyElementId": "JS###v1###Linear###getIssue",
          "methodName": "getIssue",
          "position": {
            "x": 488,
            "y": 750
          }
        },
        "flowElementId": "DA0FE7F6-3721-4230-89FD-A390AB8ACFFB",
        "groupId": null,
        "id": "6FD5916A-4774-4EBB-834D-1DD058F8CCFD",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "issueId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "issueKey",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "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": "getIssue",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Issue",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "linear",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the release's issue in Linear",
        "nextElementIds": [
          "99538C85-3663-4EB8-ACE7-3FE0E4E41693"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out the release dates Result"
          },
          "position": {
            "x": 507,
            "y": 589
          }
        },
        "flowElementId": "3E20A700-4660-4A14-8A4E-4FCA5D664D0D",
        "groupId": null,
        "id": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Work out the release dates', Error: The placeholder \"Release log issue\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "release",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Release",
                    "subPathSegments": [
                      {
                        "key": "release",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "B1D360B4-1612-4AAF-BFF2-86D5910E56A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fallbackIssue",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Release log issue",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Release log issue"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const DAY = 86400000;\nconst r = release || {};\nconst published = new Date(r.published_at || r.created_at || Date.now());\nconst day = Date.UTC(published.getUTCFullYear(), published.getUTCMonth(), published.getUTCDate());\nconst iso = t => new Date(t).toISOString().slice(0, 10);\n\nconst base = String(r.name || r.tag_name || 'Release').trim();\nlet milestone = /release/i.test(base) ? base : `Release ${base}`;\nif (milestone.length > 30) milestone = milestone.slice(0, 30).trim();\n\nconst text = `${r.name || ''}\\n${r.body || ''}`;\nconst skip = ['UTF', 'ISO', 'SHA', 'RFC', 'CVE', 'GPT', 'AES', 'HTTP', 'TLS', 'SSL', 'PR', 'V'];\nconst fromUrl = text.match(/linear\\.app\\/[^\\/\\s]+\\/issue\\/([A-Z][A-Z0-9]*-\\d+)/i);\nlet issueKey = fromUrl ? fromUrl[1].toUpperCase() : '';\nif (!issueKey) {\n  for (const m of text.matchAll(/\\b([A-Z][A-Z0-9]{1,9})-(\\d+)\\b/g)) {\n    if (!skip.includes(m[1])) { issueKey = `${m[1]}-${m[2]}`; break; }\n  }\n}\n\nreturn {\n  milestoneName: milestone,\n  releaseName: base,\n  releaseDate: iso(day),\n  releaseUrl: r.html_url || '',\n  beforeFrom: `${iso(day - 7 * DAY)} 00:00:00`,\n  beforeTo: `${iso(day - DAY)} 23:59:59`,\n  afterFrom: `${iso(day)} 00:00:00`,\n  afterTo: `${iso(day + 6 * DAY)} 23:59:59`,\n  issueKey: issueKey || String(fallbackIssue || '').trim(),\n  namedInNotes: Boolean(issueKey),\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Release dates",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out the release dates",
        "nextElementIds": [
          "A1F193FE-0C81-403F-B9D0-8898050497D7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment to a Linear issue. The comment body supports Markdown. Returns the created comment with its ID and URL.",
          "elementId": "EXTENSION:::SHARED:::default:::linear:::createComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Comment on the release's issue Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::linear:::createComment",
          "legacyElementId": "JS###v1###Linear###createComment",
          "methodName": "createComment",
          "position": {
            "x": 110,
            "y": 750
          }
        },
        "flowElementId": "18903751-E5C4-4D23-B18F-A47B03128D9A",
        "groupId": null,
        "id": "99538C85-3663-4EB8-ACE7-3FE0E4E41693",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "issueId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Issue",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6FD5916A-4774-4EBB-834D-1DD058F8CCFD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Comparison",
                    "subPathSegments": [
                      {
                        "key": "comment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2A8B6BF9-5531-4EB6-B807-6C0EB2B9FA99"
                  }
                ],
                "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": "createComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "linear",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Comment on the release's issue",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Builds a custom traffic report for a site: pageviews, visits, unique visitors, average duration or bounce rate, as totals or grouped by date and by fields such as page, referrer, country or UTM campaign, filtered and sorted. Returns one object per row, with every number as text. Accurate on data from March 2021 onwards.",
          "elementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getPageviewReport",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Traffic the week after Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getPageviewReport",
          "legacyElementId": null,
          "methodName": "getPageviewReport",
          "position": {
            "x": 110,
            "y": 220
          }
        },
        "flowElementId": "A4542E0E-472A-48A6-A1FF-985204C8FDFC",
        "groupId": "35DE61D6-8202-4756-A310-659986F6777B",
        "id": "434833E4-EADF-4348-9174-AE0BC9FE3253",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Site ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Site ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "aggregates",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "pageviews"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "visits"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "bounce_rate"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "avg_duration"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "dateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "afterFrom",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "afterTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateGrouping",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filters",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "desc"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Traffic the week after', Error: The placeholder \"Site ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getPageviewReport",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Traffic after",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fathom-analytics",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Traffic the week after",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "wait",
          "isFirstElement": false,
          "blockDefinitionId": "wait",
          "mode": "SIMPLE",
          "position": {
            "x": 1268,
            "y": 589
          }
        },
        "flowElementId": "70F9CF53-0D19-4DC4-83C3-6006BB49522B",
        "groupId": null,
        "id": "8A58CDA8-7A63-4E3B-A015-3CC3712CB21E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "delay": {
            "expression": [
              {
                "id": "NUMBER",
                "label": null,
                "type": "INPUT",
                "value": 604800
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": "DOUBLE"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "wk",
          "storeResult": true
        },
        "name": "Wait a week",
        "nextElementIds": [],
        "nextGroupIds": [
          "35DE61D6-8202-4756-A310-659986F6777B"
        ],
        "type": "WAIT"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Compare before and after Result"
          },
          "position": {
            "x": 884,
            "y": 759
          }
        },
        "flowElementId": "1E9F50BA-9076-473F-8581-D3BECAFAD514",
        "groupId": null,
        "id": "2A8B6BF9-5531-4EB6-B807-6C0EB2B9FA99",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "dates",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "trafficBefore",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Traffic before",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "44FDFA89-D196-4C3B-A389-04F812795646"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "trafficAfter",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Traffic after",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "434833E4-EADF-4348-9174-AE0BC9FE3253"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "signupsBefore",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Signups before",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "04C9E71F-1C1B-4347-A5FE-A09C757F0505"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "signupsAfter",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Signups after",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "81E4A622-75AA-4219-BA4C-1E1FDD2719B3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const num = v => { const n = Number(v); return Number.isFinite(n) ? n : 0; };\nconst first = r => (Array.isArray(r) ? r[0] : r) || {};\nconst fmt = n => Math.round(n).toLocaleString('en-US');\nconst change = (a, b) => {\n  if (b > 0) { const p = Math.round((a - b) / b * 100); return p >= 0 ? `+${p}%` : `${p}%`; }\n  return a > 0 ? 'new' : 'no change';\n};\nconst pct = v => { let n = num(v); if (n > 0 && n <= 1) n = n * 100; return n; };\nconst time = s => { const t = Math.round(num(s)); return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, '0')}`; };\n\nconst tb = first(trafficBefore), ta = first(trafficAfter);\nconst sb = first(signupsBefore), sa = first(signupsAfter);\nconst line = (label, b, a, show) => `- ${label}: ${show(b)} the week before, ${show(a)} the week after (${change(a, b)})`;\n\nconst lines = [\n  `**${dates.releaseName}: the week before and the week after, from Fathom Analytics**`,\n  `Released ${dates.releaseDate}${dates.releaseUrl ? ` ([release notes](${dates.releaseUrl}))` : ''}. The release is marked as a milestone on the Fathom Analytics graph.`,\n  '',\n  line('Pageviews', num(tb.pageviews), num(ta.pageviews), fmt),\n  line('Visitors', num(tb.visits), num(ta.visits), fmt),\n  line('Signups', num(sb.conversions), num(sa.conversions), fmt),\n  line('People who signed up', num(sb.unique_conversions), num(sa.unique_conversions), fmt),\n  `- Bounce rate: ${Math.round(pct(tb.bounce_rate))}% the week before, ${Math.round(pct(ta.bounce_rate))}% the week after`,\n  `- Average time on site: ${time(tb.avg_duration)} the week before, ${time(ta.avg_duration)} the week after`,\n  '',\n  `The week before is ${dates.beforeFrom.slice(0, 10)} to ${dates.beforeTo.slice(0, 10)}; the week after is ${dates.afterFrom.slice(0, 10)} to ${dates.afterTo.slice(0, 10)}, release day included.`,\n];\nreturn { comment: 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": "Comparison",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Compare before and after",
        "nextElementIds": [
          "6FD5916A-4774-4EBB-834D-1DD058F8CCFD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Builds a custom report for one event of a site: conversions, unique conversions or value, as totals or grouped by date and by fields such as page, referrer or UTM campaign, filtered and sorted. Returns one object per row, with every number as text and value in cents.",
          "elementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getEventReport",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Signups the week before Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getEventReport",
          "legacyElementId": null,
          "methodName": "getEventReport",
          "position": {
            "x": 110,
            "y": 400
          }
        },
        "flowElementId": "39C0B6E1-579B-4EAB-BA7F-B4A83FBF4117",
        "groupId": "35DE61D6-8202-4756-A310-659986F6777B",
        "id": "04C9E71F-1C1B-4347-A5FE-A09C757F0505",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Site ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Site ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "eventName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Signup event",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Signup event"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "aggregates",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "conversions"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "unique_conversions"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "dateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "beforeFrom",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "beforeTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateGrouping",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filters",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "desc"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Signups the week before', Error: The placeholder \"Site ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getEventReport",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Signups before",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fathom-analytics",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Signups the week before",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a new release is published in a repository. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::github:::onReleasePublished",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::github:::onReleasePublished",
          "newElementId": "EXTENSION:::SHARED:::default:::github:::onReleasePublished",
          "legacyElementId": "JS###v1###GitHub###onReleasePublished",
          "methodName": "onReleasePublished",
          "position": {
            "x": 141,
            "y": 580
          }
        },
        "flowElementId": "65C9DAC9-D172-427F-A0A2-C17EE8D3ADE7",
        "groupId": null,
        "id": "B1D360B4-1612-4AAF-BFF2-86D5910E56A7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onReleasePublished",
          "frequency": {
            "repeat": {
              "every": 900
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Release",
          "serviceId": "github",
          "slaConditions": [],
          "staticData": {
            "repository": "FlowRunner-AI/flowrunner-extensions"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New release published",
        "nextElementIds": [
          "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Builds a custom traffic report for a site: pageviews, visits, unique visitors, average duration or bounce rate, as totals or grouped by date and by fields such as page, referrer, country or UTM campaign, filtered and sorted. Returns one object per row, with every number as text. Accurate on data from March 2021 onwards.",
          "elementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getPageviewReport",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Traffic the week before Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::fathom-analytics:::getPageviewReport",
          "legacyElementId": null,
          "methodName": "getPageviewReport",
          "position": {
            "x": 110,
            "y": 760
          }
        },
        "flowElementId": "6384D423-C094-4119-8D20-39B707E257E3",
        "groupId": "35DE61D6-8202-4756-A310-659986F6777B",
        "id": "44FDFA89-D196-4C3B-A389-04F812795646",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Site ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Site ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "aggregates",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "pageviews"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "visits"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "bounce_rate"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "avg_duration"
                    }
                  ],
                  "mode": "BASIC",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "dateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "beforeFrom",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Release dates",
                    "subPathSegments": [
                      {
                        "key": "beforeTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DFAA0418-386C-48CA-83A8-1C8BDF250FEA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateGrouping",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filters",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "desc"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Traffic the week before', Error: The placeholder \"Site ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getPageviewReport",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Traffic before",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "fathom-analytics",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Traffic the week before",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "B1D360B4-1612-4AAF-BFF2-86D5910E56A7",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "actions-group",
          "isFirstElement": false,
          "blockDefinitionId": "actions-group",
          "viewport": {
            "x": 0,
            "y": 0,
            "zoom": 0.8
          },
          "position": {
            "x": 1235,
            "y": 759
          }
        },
        "flowElementId": "0C7684F9-A9DA-4AA7-B3A3-8B1A61BE2BA4",
        "groupId": null,
        "id": "35DE61D6-8202-4756-A310-659986F6777B",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Pull the week before and after', Error: Children have error",
            "valid": false
          },
          "onFailElemId": null,
          "resultAlias": "grp",
          "storeResult": true,
          "transitionMode": "ON_COMPLETION"
        },
        "name": "Pull the week before and after",
        "nextElementIds": [
          "2A8B6BF9-5531-4EB6-B807-6C0EB2B9FA99"
        ],
        "nextGroupIds": [],
        "type": "ACTIONS"
      }
    ],
    "id": "BEEE3AB3-D166-4114-9239-999729CFE4B5",
    "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": "Block 'Work out the release dates' has an invalid configuration. Code Argument 'fallbackIssue' has invalid value. Placeholder Data 'Release log issue': value is required",
      "executionStaticData": [
        {
          "description": "The Fathom Analytics site the releases affect: its site ID, the same string as in its tracking code (for example CDBUGS).",
          "error": null,
          "name": "Site ID",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The name of your signup event in Fathom Analytics, exactly as it is tracked.",
          "error": null,
          "name": "Signup event",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The Linear issue (for example ENG-42) that gets the comparison when a release's notes name no Linear issue.",
          "error": "Placeholder Data 'Release log issue': value is required",
          "name": "Release log issue",
          "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-02T01:42:23.423Z"
}
