Task: SMS Notification System

n8n workflow JSON:
{"nodes":[{"name":"Add person to Notion","type":"n8n-nodes-base.notion","position":[800,-80],"parameters":{"title":"={{$json[\"name\"]}}","resource":"databasePage","databaseId":"36a84e7c-8d2a-45cd-bfe1-2b7b0b43c4af","propertiesUi":{"propertyValues":[{"key":"Phone|phone_number","phoneValue":"={{$json[\"phone\"].length == 10 ? \"+1\" + $json[\"phone\"] : $json[\"phone\"]}}"}]}},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2},{"name":"Check for new posts","type":"n8n-nodes-base.cron","position":[440,540],"parameters":{"triggerTimes":{"item":[{}]}},"typeVersion":1},{"name":"Notion","type":"n8n-nodes-base.notion","position":[620,540],"parameters":{"limit":1,"simple":false,"filters":{"conditions":[{"key":"Link|url","condition":"is_not_empty"},{"key":"Notified Followers|checkbox","condition":"does_not_equal","checkboxValue":true}]},"options":{},"resource":"databasePage","matchType":"allFilters","operation":"getAll","databaseId":"e7f8e09e-7eeb-4814-b215-cfe8ae794d08","filterType":"manual"},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2},{"name":"Query for followers","type":"n8n-nodes-base.notion","position":[1040,700],"parameters":{"options":{},"resource":"databasePage","operation":"getAll","returnAll":true,"databaseId":"36a84e7c-8d2a-45cd-bfe1-2b7b0b43c4af"},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2},{"name":"Receive response","type":"n8n-nodes-base.webhook","position":[440,200],"webhookId":"f3fd10bd-ddea-4a1c-812d-86b20d2f0e38","parameters":{"path":"72b4971a-1e29-475b-8087-1d26306f0d1f/reply","options":{},"httpMethod":"POST"},"typeVersion":1},{"name":"Receive new signup from Tally form","type":"n8n-nodes-base.webhook","position":[440,-80],"webhookId":"f1615f2b-4b27-496d-8b0b-9f29fca6f849","parameters":{"path":"8caabd24-8eed-4d22-80c4-aeb54c744e0d","options":{},"httpMethod":"POST"},"typeVersion":1},{"name":"Set name and phone number","type":"n8n-nodes-base.set","notes":"Also remove hyphens","position":[620,-80],"parameters":{"values":{"string":[{"name":"name","value":"={{$json[\"body\"][\"data\"][\"fields\"][0][\"value\"]}}"},{"name":"phone","value":"={{$json[\"body\"][\"data\"][\"fields\"][1][\"value\"].replace(/-/g, \"\")}}"}]},"options":{},"keepOnlySet":true},"notesInFlow":true,"typeVersion":1},{"name":"Send signup confirmation text","type":"n8n-nodes-base.twilio","position":[980,-80],"parameters":{"to":"={{$json[\"property_phone\"]}}","from":"+18065152085","message":"You've successfully signed up to get notified when @stenzsends posts. To unfollow, send the message \"Unfollow\" and you will no longer receive notifications.","options":{}},"credentials":{"twilioApi":{"id":"23","name":"Twilio Account"}},"typeVersion":1},{"name":"Mark that notification has been sent","type":"n8n-nodes-base.notion","notes":"I do this before because if there is an error executing this node then it will notify people twice. ","position":[860,700],"parameters":{"pageId":"={{$json[\"id\"]}}","simple":false,"resource":"databasePage","operation":"update","propertiesUi":{"propertyValues":[{"key":"Notified Followers|checkbox","checkboxValue":true}]}},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2},{"name":"Merge","type":"n8n-nodes-base.merge","position":[1280,560],"parameters":{"mode":"multiplex"},"typeVersion":1},{"name":"Get TikTok link","type":"n8n-nodes-base.set","position":[1040,540],"parameters":{"values":{"string":[{"name":"link","value":"={{$json[\"properties\"][\"Link\"][\"url\"]}}"}]},"options":{},"keepOnlySet":true},"typeVersion":1},{"name":"Check for \"unfollow\" text","type":"n8n-nodes-base.if","position":[620,200],"parameters":{"conditions":{"boolean":[{"value1":"={{$json[\"body\"][\"Body\"].toLowerCase().includes(\"unfollow\")}}","value2":true}]}},"typeVersion":1},{"name":"Find user","type":"n8n-nodes-base.notion","position":[820,180],"parameters":{"limit":1,"filters":{"conditions":[{"key":"Phone|phone_number","condition":"equals","phoneNumberValue":"={{$json[\"body\"][\"From\"]}}"}]},"options":{},"resource":"databasePage","matchType":"allFilters","operation":"getAll","databaseId":"36a84e7c-8d2a-45cd-bfe1-2b7b0b43c4af","filterType":"manual"},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2,"alwaysOutputData":true},{"name":"Stop And Error","type":"n8n-nodes-base.stopAndError","position":[1180,340],"parameters":{"errorMessage":"Unfollow request unsuccessful. Could not find a matching phone number."},"typeVersion":1},{"name":"Was user returned","type":"n8n-nodes-base.if","position":[1000,180],"parameters":{"conditions":{"boolean":[{"value1":"={{Object.keys($json).length > 0}}","value2":true}]}},"typeVersion":1},{"name":"Send unfollow successful message","type":"n8n-nodes-base.twilio","position":[1360,160],"parameters":{"to":"={{$json[\"property_phone\"]}}","from":"+18065152085","message":"You've successfully unfollowed @stenzsends. You will no longer receive notifications.","options":{}},"credentials":{"twilioApi":{"id":"23","name":"Twilio Account"}},"typeVersion":1},{"name":"Remove user from followers db","type":"n8n-nodes-base.notion","position":[1180,160],"parameters":{"pageId":"={{$json[\"id\"]}}","operation":"archive"},"credentials":{"notionApi":{"id":"2","name":"n8n Personal Workflows"}},"typeVersion":2,"alwaysOutputData":true},{"name":"Send notification message","type":"n8n-nodes-base.twilio","position":[1480,560],"parameters":{"to":"={{$json[\"property_phone\"]}}","from":"+18065152085","message":"=A new TikTok has been posted by @stenzsends. Check it out here {{$json[\"link\"]}}","options":{}},"credentials":{"twilioApi":{"id":"23","name":"Twilio Account"}},"typeVersion":1}],"connections":{"Merge":{"main":[[{"node":"Send notification message","type":"main","index":0}]]},"Notion":{"main":[[{"node":"Mark that notification has been sent","type":"main","index":0},{"node":"Get TikTok link","type":"main","index":0}]]},"Find user":{"main":[[{"node":"Was user returned","type":"main","index":0}]]},"Get TikTok link":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Receive response":{"main":[[{"node":"Check for \"unfollow\" text","type":"main","index":0}]]},"Was user returned":{"main":[[{"node":"Remove user from followers db","type":"main","index":0}],[{"node":"Stop And Error","type":"main","index":0}]]},"Check for new posts":{"main":[[{"node":"Notion","type":"main","index":0}]]},"Query for followers":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Add person to Notion":{"main":[[{"node":"Send signup confirmation text","type":"main","index":0}]]},"Check for \"unfollow\" text":{"main":[[{"node":"Find user","type":"main","index":0}]]},"Set name and phone number":{"main":[[{"node":"Add person to Notion","type":"main","index":0}]]},"Remove user from followers db":{"main":[[{"node":"Send unfollow successful message","type":"main","index":0}]]},"Receive new signup from Tally form":{"main":[[{"node":"Set name and phone number","type":"main","index":0}]]},"Mark that notification has been sent":{"main":[[{"node":"Query for followers","type":"main","index":0}]]}}}