{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "0f9a301c-3c4e-4b93-9acb-aaac7dc71767",
      "name": "Monitor Order Status Changes",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        560,
        240
      ],
      "parameters": {
        "baseId": {
          "__rl": true,
          "mode": "url",
          "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq"
        },
        "tableId": {
          "__rl": true,
          "mode": "url",
          "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq?blocks=hide"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerField": "Created",
        "authentication": "airtableTokenApi",
        "additionalFields": {}
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3fd2c55-69bb-4deb-960b-4fce09c97a6a",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        768,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e60a21c7-574a-4579-9e7f-57cf6b9f50c9",
              "name": "orders_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tblhBgneMJ0mEPHKy/viw2ySMTX32PaQmXn?blocks=hide"
            },
            {
              "id": "d40b4f55-a7e1-4735-9d6f-d5d3f88ba8ec",
              "name": "notifications_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tblOkTpwjGgApgnDD/viw5KFPiq3xMvzrrq?blocks=hide"
            },
            {
              "id": "bad7583e-9699-4fec-a6f9-697f595c093e",
              "name": "scripts_table_url",
              "type": "string",
              "value": "https://airtable.com/appaeASO1AZV62pLI/tbltfdPxUeOVGbb1l/viwFwsRKskE2F5b67?blocks=hide"
            },
            {
              "id": "e39b8ae5-c53a-4186-9ec5-6c352cd1d7e4",
              "name": "from_number",
              "type": "string",
              "value": "+1234567890"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "4be3c39c-6be2-49cd-81bc-368a501eb9cd",
      "name": "Combine Config with Order Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1328,
        16
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "70b22256-8e20-4eb5-99df-eef81da8ef12",
      "name": "Prepare SMS Content",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "463668f7-11f7-48d2-91c3-635a78637c7f",
              "name": "Message",
              "type": "string",
              "value": "=Hi {{ $json.fields['First Name (from Order)'][0] }}, Your order status changed to: {{ $json.fields['Order Status'] }}. Any questions, call us!"
            },
            {
              "id": "3ddbf667-aa74-4ddb-b12e-6bf1294fdaa3",
              "name": "To",
              "type": "string",
              "value": "={{ $json.fields['Customer Phone Number (from Order)'][0] }}"
            },
            {
              "id": "609250bc-7ae0-4213-9611-a60b3ac63eaa",
              "name": "From",
              "type": "string",
              "value": "={{ $json.from_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a4a0103e-9fe8-4076-bee8-6c8c34a3fae6",
      "name": "Send Order Status SMS",
      "type": "n8n-nodes-base.twilio",
      "onError": "continueRegularOutput",
      "position": [
        1728,
        16
      ],
      "parameters": {
        "to": "={{ $json.To }}",
        "from": "={{ $json.From }}",
        "message": "={{ $json.Message }}",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cd039e97-d4f4-4d67-bc1b-f972d79ba2d5",
      "name": "Check SMS Delivery",
      "type": "n8n-nodes-base.if",
      "position": [
        1936,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3f814939-8cea-4114-aed8-9f4202c7eb80",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ !$json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d85bf204-a0b4-4f00-aa04-2704ea7787af",
      "name": "Filter Pending Notifications",
      "type": "n8n-nodes-base.if",
      "position": [
        944,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "223f9988-650a-4fcc-9a65-2f240c4b3dce",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.fields['Message Status'] }}",
              "rightValue": "To send"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b079226c-e475-438e-8fa8-46b82d129a21",
      "name": "Mark Notification as Sending",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1184,
        192
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Sending..."
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "eff63937-f30e-4d03-8c14-07091abb0bbc",
      "name": "Mark Notification as Success",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2176,
        -80
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Success"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35bb7ae7-8b76-4eb4-8be3-c9f270887039",
      "name": "Mark Notification as Failed",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2176,
        128
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "table": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.notifications_table_url }}"
        },
        "columns": {
          "value": {
            "id": "={{ $('Config').item.json.id }}",
            "Message Status": "Error"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "New",
                  "value": "New"
                },
                {
                  "name": "Confirmed",
                  "value": "Confirmed"
                },
                {
                  "name": "Shipped",
                  "value": "Shipped"
                }
              ],
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Order",
              "type": "array",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Order",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "To send",
                  "value": "To send"
                },
                {
                  "name": "Sending...",
                  "value": "Sending..."
                },
                {
                  "name": "Success",
                  "value": "Success"
                },
                {
                  "name": "Error",
                  "value": "Error"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Message Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c42f9334-652d-485b-aab2-08380db4af6f",
      "name": "Configuration Helper",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        64
      ],
      "parameters": {
        "width": 272,
        "content": "## Configure here \ud83d\udc47\ud83d\udc47\nUpdate these URLs to match your Airtable base:\n- orders_table_url\n- notifications_table_url\n- scripts_table_url (optional)\n- from_number (your Twilio number)"
      },
      "typeVersion": 1
    },
    {
      "id": "contact-note-1759930148724",
      "name": "Creator Contact Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -690
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 440,
        "content": "# Contact Us:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n\n\n### We help businesses eliminate busywork by building compact business tools tailored to your process.\n### Contact us for customizing this, or building similar automations.\n\n\ud83d\udce7 hello@smoothwork.ai\n\u25b6\ufe0f [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n\ud83d\udcde [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mil%C3%A1n-v%C3%A1s%C3%A1rhelyi-3a9985123/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "doc-note-1759930148724",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -250
      ],
      "parameters": {
        "width": 600,
        "height": 1100,
        "content": "## Workflow Overview\n\nThis workflow automatically sends personalized SMS notifications to customers when their order status changes in Airtable. Perfect for e-commerce businesses, this automation monitors your order management base and instantly notifies customers about status updates like \"Confirmed\" or \"Shipped.\"\n\nWhen an order status changes in your Orders table, a notification record is created in a Status Notifications table. The workflow monitors this table every minute, prepares personalized messages using the customer's name and order status, sends the SMS via Twilio, and updates the delivery status back to Airtable for complete tracking.\n\n### First Setup\n\n1. **Duplicate the Airtable Base**: Copy the [Order Management Base template](https://airtable.com/appaeASO1AZV62pLI/shrBP0lmBNXk0G7Vf) to your Airtable workspace\n2. **Connect Airtable**: Add your Airtable Personal Access Token credentials to the workflow nodes\n3. **Set up Twilio**: Create a [Twilio account](https://www.twilio.com) (free trial available) and obtain your Account SID, Auth Token, and Twilio phone number\n4. **Connect Twilio**: Add your Twilio credentials to the \"Send Order Status SMS\" node\n\n### Configuration\n\nIn the **Config** node, update these values with your own:\n- `notifications_table_url`: URL of your duplicated Status Notifications table\n- `orders_table_url`: URL of your Orders table (optional, for reference)\n- `scripts_table_url`: URL of your scripts table (optional)\n- `from_number`: Your Twilio phone number\n\nCustomize the SMS message template in the \"Prepare SMS Content\" node to match your brand voice and include additional order details as needed."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Filter Pending Notifications",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check SMS Delivery": {
      "main": [
        [
          {
            "node": "Mark Notification as Success",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark Notification as Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare SMS Content": {
      "main": [
        [
          {
            "node": "Send Order Status SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Order Status SMS": {
      "main": [
        [
          {
            "node": "Check SMS Delivery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Pending Notifications": {
      "main": [
        [
          {
            "node": "Combine Config with Order Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mark Notification as Sending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Notification as Sending": {
      "main": [
        [
          {
            "node": "Combine Config with Order Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Monitor Order Status Changes": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Config with Order Data": {
      "main": [
        [
          {
            "node": "Prepare SMS Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}