Production Workflow
Production-ready workflow: Production Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation.
Prerequisites
Required Credentials (2)
Complexity
Advanced features used. Requires n8n experience.
When to Use This Workflow
Real-time Response
React instantly when events happen - new orders, form submissions, or API calls.
Zero delay between trigger and action for time-sensitive workflows.
Time Savings
Replace repetitive manual tasks with reliable automation.
Reclaim hours every week for higher-value work.
Error Reduction
Eliminate human error from routine processes with consistent automation.
Improve accuracy and reliability across your workflows.
{
"nodes": [
{
"name": "Function",
"type": "n8n-nodes-base.function",
"position": [
230,
710
],
"parameters": {
"functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n\n// Loop over inputs and add a new field called 'myNewField' to the JSON of each one\nfor (item of items) {\n \nvar type = \"Status\";\n// Acknowledged\nif ((item.json.body.alert.statusCode == 2) && (item.json.body.eventType == 201)) {\n type = \"Acknowledged\";\n}\n// Closed\nif ((item.json.body.alert.statusCode == 4) & (item.json.body.eventType == 201)) {\n type = \"Closed\";\n}\n// New Alert\nif ((item.json.body.alert.statusCode == 1) & (item.json.body.eventType == 200)) {\n type = \"New Alert\";\n}\n\n// No one on duty\nif ((item.json.body.alert.statusCode == 16) & (item.json.body.eventType == 201)) {\n type = \"No one on duty\";\n}\n \n// Annotation\nvar annotation = \"\";\nif ((item.json.body.eventType == 203) & (item.json.body.annotation != undefined) ) {\n type = \"Annotated\";\n annotation = item.json.body.annotation.message;\n}\nif (annotation != \"\") {\n annotation = \": \" + annotation;\n}\n \nvar username = \"System\";\nif (item.json.body.user != undefined) {\n username = item.json.body.user.username;\n}\n \nvar data = type + \" by \" + username + annotation;\n \nitem.json.s4Status = data; // + \": \" + JSON.stringify(item.json);\n\n\nitem.json.s4Up = false;\nif (type == \"Closed\") {\n item.json.s4Up = true;\n}\n\n}\n\n// You can write logs to the browser console\nconsole.log('Done!');\n\nreturn items;\n\n\n"
},
"typeVersion": 1,
"id": "node-05b80966"
},
{
"name": "Notion Trigger",
"type": "n8n-nodes-base.notionTrigger",
"disabled": true,
"position": [
...Related Workflows
Webhook Workflow
Automated workflow: Webhook Workflow. This workflow integrates 8 different services: webhook, stickyNote, filter, airtab...
AI Agent for project management and meetings with Airtable and Fireflies
Replace API key for Fireflies
Conversational Interviews with AI Agents and n8n Forms
🚨 Set Interview Topic Here!
Notion AI Assistant Generator
Generate new workflow version for specific notion db schema Input a Notion database URL and get an AI Assistant chatbot...
Notion knowledge base AI assistant
Notion knowledge base assistant [v1] Built as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@ma...
Store Notion's Pages as Vector Documents into Supabase with OpenAI
Store Notion's Pages as Vector Documents into Supabase This workflow assumes you have a Supabase project with a table th...