{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "C221E822-1DF1-45F8-9840-556DCE50A0BD",
    "name": "Extracta.ai: emailed invoice to a QuickBooks bill"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -32.131147540983605,
        "y": 13.770491803278691,
        "zoom": 0.66
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a supplier emails an invoice, Extracta.ai reads it with your Invoices extraction. A new invoice whose lines add up to its total becomes a QuickBooks Online bill with the PDF attached; anything else goes to the AP clerk in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a supplier emails an invoice, Extracta.ai reads it with your Invoices extraction. A new invoice whose lines add up to its total becomes a QuickBooks Online bill with the PDF attached; anything else goes to the AP clerk in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Triggers when an email with a new attachment is received. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "legacyElementId": "JS###v1###GmailService###onNewAttachment",
          "methodName": "onNewAttachment",
          "position": {
            "x": 128,
            "y": 40
          }
        },
        "flowElementId": "1548757A-3428-46F8-8E96-4EA43F521C77",
        "groupId": null,
        "id": "7328F735-60C3-4B25-AD58-4C91E9F1351C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewAttachment",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New invoice email",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "subject:invoice has:attachment"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New invoice email",
        "nextElementIds": [
          "93D7D88C-6441-407A-9475-00D691F23A54"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "If Extracta.ai can't read it Result"
          },
          "position": {
            "x": 1567,
            "y": 49
          }
        },
        "flowElementId": "86CEC77C-5799-4E4B-9F2D-997FD34D89B2",
        "groupId": null,
        "id": "6982D0BD-E984-43B7-A559-3F3005689135",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Read error",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "If Extracta.ai can't read it",
        "nextElementIds": [
          "F5E32741-15E8-4CD9-A383-912718F481F8"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "File link": "48a836ed-10d2-439c-a903-b84d209c1246"
          },
          "position": {
            "x": 845,
            "y": 49
          }
        },
        "flowElementId": "64384091-C8CE-44DD-BEBA-F7F662F9B516",
        "groupId": null,
        "id": "EF00CE5D-B4BC-4DB6-9C47-D42F751DB4C5",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "File link",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "93D7D88C-6441-407A-9475-00D691F23A54"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "bucket1",
          "storeResult": true
        },
        "name": "Keep the file link",
        "nextElementIds": [
          "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "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 AP the supplier is new Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 452,
            "y": 340
          }
        },
        "flowElementId": "19BE1376-2D13-48B1-83DB-BE0A5CA7785F",
        "groupId": null,
        "id": "BF2F7E99-3C9C-4D81-AFCC-AB9850CD69F8",
        "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": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Extracta.ai read invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "invoice_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " from "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "supplier_name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " (total "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "), but QuickBooks has no vendor by that name. Add the vendor and forward the email to the AP inbox again, or enter the bill by hand. <"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "93D7D88C-6441-407A-9475-00D691F23A54"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "|Open the invoice>"
                  }
                ],
                "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": "New supplier note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell AP the supplier is new",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries bills in QuickBooks Online with optional filtering. You can filter by vendor, bill number (exact or containing a text) and total amount range. Results are paginated and sorted by transaction date in descending order.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listBills",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check for a duplicate bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listBills",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listBills",
          "methodName": "listBills",
          "position": {
            "x": 457,
            "y": 210
          }
        },
        "flowElementId": "DE915CF5-3F61-4A6F-A779-76AD8E493266",
        "groupId": null,
        "id": "D7CDC5B3-4656-4163-8F43-24C022BA1F6B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vendorId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks supplier",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Vendor",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 5
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "invoice_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "minAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Check for a duplicate bill', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listBills",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Existing bills",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check for a duplicate bill",
        "nextElementIds": [
          "AD098D89-BC21-434A-A084-E64F89FD87CF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 472,
            "y": 40
          }
        },
        "flowElementId": "7D8ACAF8-5F0C-476B-8C40-C7563EFF5414",
        "groupId": null,
        "id": "93D7D88C-6441-407A-9475-00D691F23A54",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileOptions",
              "type": "OBJECT",
              "value": [
                {
                  "name": "scope",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "FLOW"
                      }
                    ],
                    "mode": "BASIC",
                    "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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the invoice",
        "nextElementIds": [
          "EF00CE5D-B4BC-4DB6-9C47-D42F751DB4C5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Uploads one document to an extraction, waits for Extracta.ai to process it and returns the extracted data. Checks for the result every 3 seconds, up to Maximum Wait.",
          "elementId": "EXTENSION:::SHARED:::default:::extracta-ai:::extractDataFromFile",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the invoice in Extracta.ai Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::extracta-ai:::extractDataFromFile",
          "legacyElementId": null,
          "methodName": "extractDataFromFile",
          "position": {
            "x": 1197,
            "y": 40
          }
        },
        "flowElementId": "01B31330-8BEC-4AC0-993D-9CDE1430BFA6",
        "groupId": null,
        "id": "80E3DD06-C696-4DF1-8105-73848F1E2BB6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "extractionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Invoices extraction ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Invoices extraction ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "93D7D88C-6441-407A-9475-00D691F23A54"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxWaitSeconds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 300
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the invoice in Extracta.ai', Error: The placeholder \"Invoices extraction ID\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "extractDataFromFile",
          "onFailElemId": "6982D0BD-E984-43B7-A559-3F3005689135",
          "packageId": "default",
          "resultAlias": "Extracted invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "extracta-ai",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the invoice in Extracta.ai",
        "nextElementIds": [
          "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries vendors in QuickBooks Online with optional filtering. Search matches part of the DisplayName; Display Name and Company Name match the whole name exactly, to find one vendor (e.g. a carrier) reliably. QuickBooks cannot filter vendors by tax ID, and masks it in responses. Results are paginated and sorted by DisplayName.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listVendors",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the supplier in QuickBooks Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listVendors",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listVendors",
          "methodName": "listVendors",
          "position": {
            "x": 1192,
            "y": 210
          }
        },
        "flowElementId": "AEA2A243-80FA-4DF9-A9EE-D42D2C8A6D34",
        "groupId": null,
        "id": "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "supplier_name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 5
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "displayName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "companyName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the supplier in QuickBooks', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listVendors",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "QuickBooks supplier",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the supplier in QuickBooks",
        "nextElementIds": [
          "46EE9540-BB99-4BF8-BBAE-DA7F73CCBC84"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 832,
            "y": 219
          }
        },
        "flowElementId": "AB44371E-1D47-48B6-B885-96289FBB9388",
        "groupId": null,
        "id": "46EE9540-BB99-4BF8-BBAE-DA7F73CCBC84",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "2d8ccc39-4a66-4df3-9ebc-9d56c377f33f",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "QuickBooks supplier",
                      "subPathSegments": [
                        {
                          "key": "QueryResponse",
                          "optional": false
                        },
                        {
                          "key": "Vendor",
                          "optional": false
                        },
                        {
                          "index": 0,
                          "last": false
                        },
                        {
                          "key": "Id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "2d8ccc39-4a66-4df3-9ebc-9d56c377f33f"
            ]
          },
          "elseComponent": {
            "componentId": "BF2F7E99-3C9C-4D81-AFCC-AB9850CD69F8",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Supplier found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "D7CDC5B3-4656-4163-8F43-24C022BA1F6B",
            "componentType": "ELEMENT"
          }
        },
        "name": "Supplier in QuickBooks?",
        "nextElementIds": [
          "BF2F7E99-3C9C-4D81-AFCC-AB9850CD69F8",
          "D7CDC5B3-4656-4163-8F43-24C022BA1F6B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": "Send the unread invoice to AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1899,
            "y": 40
          }
        },
        "flowElementId": "10B3FC0C-3DD8-4776-B833-61597F570CC2",
        "groupId": null,
        "id": "F5E32741-15E8-4CD9-A383-912718F481F8",
        "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": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Extracta.ai did not return the invoice "
                  },
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " from "
                  },
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " ("
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Read error",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6982D0BD-E984-43B7-A559-3F3005689135"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). Nothing was entered in QuickBooks. <"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "93D7D88C-6441-407A-9475-00D691F23A54"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "|Open the invoice>"
                  }
                ],
                "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": "Unread note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the unread invoice to AP",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries the chart of accounts in QuickBooks Online with optional filtering by name and account type. Results are paginated and sorted by name.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listAccounts",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the expense account Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listAccounts",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listAccounts",
          "methodName": "listAccounts",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "60276924-2103-4204-9299-AFE9359187CA",
        "groupId": null,
        "id": "AD098D89-BC21-434A-A084-E64F89FD87CF",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Expense account",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Expense account"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accountType",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 20
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the expense account', Error: The placeholder \"Expense account\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listAccounts",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Expense accounts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the expense account",
        "nextElementIds": [
          "4C38E579-277E-4F5E-869F-1D458D4120F5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "File link": "6c646a33-8242-4e0f-a1d0-cfc3adacef87"
          },
          "position": {
            "x": 128,
            "y": 689
          }
        },
        "flowElementId": "909B5247-7147-4AF8-9DD3-4A8897671C0D",
        "groupId": null,
        "id": "BE2E2CEE-E2A5-4AC0-AB4D-B6CBF5255B46",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "File link",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fresh copy",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "466C073E-1A7F-46E1-BF50-7E5AADC06CD8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "bucket2",
          "storeResult": true
        },
        "name": "Use the fresh copy",
        "nextElementIds": [
          "BD09F0A6-1C4C-443E-9291-3EFB614B9207"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the AP clerk Result"
          },
          "position": {
            "x": 797,
            "y": 519
          }
        },
        "flowElementId": "380393EB-0780-4171-9814-59EB24B420D6",
        "groupId": null,
        "id": "B31B578F-A3A4-4FBF-AFA3-521BA46F6D63",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the question for the AP clerk', Error: The placeholder \"Answer link\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "invoiceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "invoice_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "supplier",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks supplier",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Vendor",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "DisplayName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sender",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "total",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineSum",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "lineSum",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "problems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "problems",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "93D7D88C-6441-407A-9475-00D691F23A54"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst title = `Invoice ${invoiceNumber || '(no number)'} from ${supplier || 'an unknown supplier'} needs a look before it is booked`;\nconst lines = [\n  `*${title}*`,\n  `Sent by: ${sender}`,\n  `Read by Extracta.ai: total ${total ?? 'not read'}, lines${lineSum ? ` ${lineSum}` : ' not read'}`,\n  ...(Array.isArray(problems) ? problems : []).map((p) => `- ${p}`),\n  `<${fileUrl}|Open ${fileName || 'the invoice'}>`,\n];\nreturn {\n  text: title,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Book it' }, url: link('book') },\n      { type: 'button', text: { type: 'plain_text', text: 'Hold it' }, url: link('hold') },\n    ] },\n  ],\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the AP clerk",
        "nextElementIds": [
          "DBE518C6-2743-44D3-B7E2-69E379BE3161"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Attaches a file, such as the vendor's PDF invoice or a scanned receipt, to an existing bill in QuickBooks Online. The file is downloaded from the given URL (for example a FlowRunner file URL from an earlier step) and uploaded as an attachment linked to the bill. Returns the created attachment.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::attachFileToBill",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Attach the invoice to the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::attachFileToBill",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###attachFileToBill",
          "methodName": "attachFileToBill",
          "position": {
            "x": 446,
            "y": 980
          }
        },
        "flowElementId": "DD2471A9-A264-4B52-90C9-04E3431E0ECB",
        "groupId": null,
        "id": "C5A3A9C6-F75E-4625-A399-380D5E6AF302",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "Bill",
                        "optional": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "BD09F0A6-1C4C-443E-9291-3EFB614B9207"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - File link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.File link",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "File link",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contentType",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "note",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Attach the invoice to the bill', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "attachFileToBill",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Bill attachment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Attach the invoice to the bill",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 845,
            "y": 689
          }
        },
        "flowElementId": "51AAB81F-6AC6-4F34-B3B7-5BC15ED3137D",
        "groupId": null,
        "id": "93E27850-9363-42D9-84BF-FE5531D6BFB5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "ca44e09a-a67f-4dda-9fe5-daca136e6bc0",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "AP decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "787917E9-5E86-48AE-9AA3-BF93F7C09750"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "book"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "ca44e09a-a67f-4dda-9fe5-daca136e6bc0"
            ]
          },
          "elseComponent": {
            "componentId": "C1841436-1960-4D18-BE0C-790CDE622F69",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Book it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "466C073E-1A7F-46E1-BF50-7E5AADC06CD8",
            "componentType": "ELEMENT"
          }
        },
        "name": "Book it?",
        "nextElementIds": [
          "C1841436-1960-4D18-BE0C-790CDE622F69",
          "466C073E-1A7F-46E1-BF50-7E5AADC06CD8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the invoice Result"
          },
          "position": {
            "x": 128,
            "y": 519
          }
        },
        "flowElementId": "13312893-8D40-4351-AD0C-DECB4ABEBC21",
        "groupId": null,
        "id": "4C38E579-277E-4F5E-869F-1D458D4120F5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Check the invoice', Error: The placeholder \"Expense account\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "invoice",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "existing",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Existing bills",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Bill",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D7CDC5B3-4656-4163-8F43-24C022BA1F6B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accounts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Expense accounts",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Account",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AD098D89-BC21-434A-A084-E64F89FD87CF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accountName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Expense account",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Expense account"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const money = (v) => { const n = parseFloat(String(v ?? '').replace(/[^0-9.-]/g, '')); return Number.isFinite(n) ? Math.round(n * 100) / 100 : null; };\nconst iso = (v) => { const s = String(v ?? '').trim(); if (!s) return ''; if (/^\\d{4}-\\d{2}-\\d{2}$/.test(s)) return s; const d = new Date(s); return isNaN(d) ? '' : d.toISOString().slice(0, 10); };\nconst inv = invoice || {};\nconst items = (Array.isArray(inv.line_items) ? inv.line_items : [])\n  .map((l) => ({ description: String((l && l.description) || '').trim() || 'Invoice line', amount: money(l && l.amount) }))\n  .filter((l) => l.amount !== null && l.amount !== 0);\nconst tax = money(inv.tax) || 0;\nconst total = money(inv.total);\nconst lineSum = Math.round((items.reduce((s, l) => s + l.amount, 0) + tax) * 100) / 100;\nconst addsUp = total !== null && items.length > 0 && Math.abs(lineSum - total) <= 0.005;\nconst problems = [];\nif (!inv.invoice_number) problems.push('No invoice number was read');\nif (total === null) problems.push('No total was read');\nelse if (!items.length) problems.push('No line items were read');\nelse if (!addsUp) problems.push(`The lines${tax ? ' and tax' : ''} add up to ${lineSum.toFixed(2)}, but the invoice total is ${total.toFixed(2)}`);\nconst dup = (Array.isArray(existing) ? existing : [])[0];\nif (dup) problems.push(`QuickBooks already has bill ${inv.invoice_number} from this supplier (bill ID ${dup.Id}, dated ${dup.TxnDate || 'unknown'}, total ${dup.TotalAmt})`);\nconst wanted = String(accountName || '').trim().toLowerCase();\nconst account = (Array.isArray(accounts) ? accounts : []).find((a) => [a.Name, a.FullyQualifiedName].some((n) => String(n || '').trim().toLowerCase() === wanted));\nif (!account) throw new Error(`QuickBooks has no account named \"${accountName}\". Set the flow setting Expense account to the account supplier bills are booked to.`);\nconst line = (description, amount) => ({ DetailType: 'AccountBasedExpenseLineDetail', Amount: amount, Description: description, AccountBasedExpenseLineDetail: { AccountRef: { value: String(account.Id) } } });\nconst lines = addsUp\n  ? [...items.map((l) => line(l.description, l.amount)), ...(tax ? [line('Tax', tax)] : [])]\n  : [line(`Invoice ${inv.invoice_number || ''} total`.replace(/\\s+/g, ' '), total || 0)];\nreturn {\n  clean: problems.length === 0,\n  problems,\n  lineSum,\n  total,\n  invoiceDate: iso(inv.invoice_date),\n  dueDate: iso(inv.due_date),\n  lines,\n  note: problems.length\n    ? `Read by Extracta.ai from ${fileName}. Booked after the AP clerk approved it in Slack. Flagged: ${problems.join('; ')}.`\n    : `Read by Extracta.ai from ${fileName}. The lines add up to the total.`,\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Invoice check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check the invoice",
        "nextElementIds": [
          "B54DED14-7DDD-4FB5-B279-9462BC134C3D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 472,
            "y": 519
          }
        },
        "flowElementId": "1F7917EE-E902-4982-A4F5-5318B76F1212",
        "groupId": null,
        "id": "B54DED14-7DDD-4FB5-B279-9462BC134C3D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f8148584-2eb4-4d5d-b9d2-c5d13a5ba700",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice check",
                      "subPathSegments": [
                        {
                          "key": "clean",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "f8148584-2eb4-4d5d-b9d2-c5d13a5ba700"
            ]
          },
          "elseComponent": {
            "componentId": "B31B578F-A3A4-4FBF-AFA3-521BA46F6D63",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Clean invoice",
          "storeResult": false,
          "thenComponent": {
            "componentId": "BD09F0A6-1C4C-443E-9291-3EFB614B9207",
            "componentType": "ELEMENT"
          }
        },
        "name": "Adds up and new?",
        "nextElementIds": [
          "B31B578F-A3A4-4FBF-AFA3-521BA46F6D63",
          "BD09F0A6-1C4C-443E-9291-3EFB614B9207"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new bill in QuickBooks Online to record an amount owed to a vendor. Give the lines either as Lines (one row per line: an Account and Amount, or an Item with Quantity and Unit Price, no JSON needed) or as Line Items in QuickBooks JSON; when both are given, the Line Items come first.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createBill",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createBill",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###createBill",
          "methodName": "createBill",
          "position": {
            "x": 128,
            "y": 980
          }
        },
        "flowElementId": "4C045E44-104D-4B85-9921-A4831CFD715C",
        "groupId": null,
        "id": "BD09F0A6-1C4C-443E-9291-3EFB614B9207",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vendorId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks supplier",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Vendor",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C1FA7C2D-BEDB-4087-B4E2-591BFA7D493C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "lines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "dueDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "txnDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "invoiceDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "privateNote",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice check",
                    "subPathSegments": [
                      {
                        "key": "note",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4C38E579-277E-4F5E-869F-1D458D4120F5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "invoice_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lines",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the bill', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createBill",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the bill",
        "nextElementIds": [
          "C5A3A9C6-F75E-4625-A399-380D5E6AF302"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 1197,
            "y": 689
          }
        },
        "flowElementId": "346F5A8E-0ABC-45C9-AB49-EACD729FDC14",
        "groupId": null,
        "id": "787917E9-5E86-48AE-9AA3-BF93F7C09750",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "AP decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the AP clerk's answer",
        "nextElementIds": [
          "93E27850-9363-42D9-84BF-FE5531D6BFB5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "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": "Confirm the invoice is held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 451,
            "y": 810
          }
        },
        "flowElementId": "5A99754A-0D29-49CE-ACF2-D598343863FA",
        "groupId": null,
        "id": "C1841436-1960-4D18-BE0C-790CDE622F69",
        "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": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Held. Invoice "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Extracted invoice",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "result",
                        "optional": false
                      },
                      {
                        "key": "invoice_number",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "80E3DD06-C696-4DF1-8105-73848F1E2BB6"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " was not entered in QuickBooks."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to AP",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DBE518C6-2743-44D3-B7E2-69E379BE3161"
                  }
                ],
                "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": "Held note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the invoice is held",
        "nextElementIds": [],
        "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": "Ask the AP clerk Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1230,
            "y": 510
          }
        },
        "flowElementId": "CE97D65F-148C-436D-BCD6-FF957697BADE",
        "groupId": null,
        "id": "DBE518C6-2743-44D3-B7E2-69E379BE3161",
        "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": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B31B578F-A3A4-4FBF-AFA3-521BA46F6D63"
                  }
                ],
                "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": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B31B578F-A3A4-4FBF-AFA3-521BA46F6D63"
                  }
                ],
                "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": "Question to AP",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the AP clerk",
        "nextElementIds": [
          "787917E9-5E86-48AE-9AA3-BF93F7C09750"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save a fresh copy Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 472,
            "y": 680
          }
        },
        "flowElementId": "01DCA339-7E4F-4D5C-A8D9-E40559D2AE96",
        "groupId": null,
        "id": "466C073E-1A7F-46E1-BF50-7E5AADC06CD8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7328F735-60C3-4B25-AD58-4C91E9F1351C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileOptions",
              "type": "OBJECT",
              "value": [
                {
                  "name": "scope",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "FLOW"
                      }
                    ],
                    "mode": "BASIC",
                    "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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Fresh copy",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save a fresh copy",
        "nextElementIds": [
          "BE2E2CEE-E2A5-4AC0-AB4D-B6CBF5255B46"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "7328F735-60C3-4B25-AD58-4C91E9F1351C",
    "groups": [],
    "id": "2DC3550B-FC96-4730-83E3-8807E49E98F5",
    "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 'Write the question for the AP clerk' has an invalid configuration. Code Argument 'answerLink' has invalid value. Placeholder Data 'Answer link': value is required",
      "executionStaticData": [
        {
          "description": "The ID of your Invoices extraction in Extracta.ai (shown in the Extracta.ai dashboard).",
          "error": null,
          "name": "Invoices extraction ID",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The exact name of the QuickBooks Online account supplier bills are booked to.",
          "error": "Placeholder Data 'Expense account': value is required",
          "name": "Expense account",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The URL of the block Wait for the AP clerk's answer. The Slack buttons open it.",
          "error": "Placeholder Data 'Answer link': value is required",
          "name": "Answer link",
          "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:41:13.507Z"
}
