Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-r1-0528· DeepSeekHugging Face LMArena Human Preference 140K

Please create an advanced n8n workflow. Make it in json format so I can just upload a…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514-thinking-32k’s answer.
  1. User

    Please create an advanced n8n workflow. Make it in json format so I can just upload a file and use this workflow.

  2. DeepSeek Assistant

    Here's an advanced n8n workflow in JSON format that demonstrates a multi-step automation with error handling, data transformation, and integrations with Slack, Google Sheets, and external APIs. This workflow performs currency conversion rate monitoring with alerting:

    {
      "nodes": [
        {
          "parameters": {
            "interval": 60,
            "unit": "minutes"
          },
          "name": "Scheduler",
          "type": "n8n-nodes-base.interval",
          "typeVersion": 1,
          "position": [
            250,
            300
          ]
        },
        {
          "parameters": {
            "url": "https://api.exchangerate.host/latest?base=USD&symbols=EUR,GBP,JPY",
            "responseFormat": "json",
            "options": {}
          },
          "name": "FetchExchangeRates",
          "type": "n8n-nodes-base.httpRequest",
          "typeVersion": 1,
          "position": [
            450,
            300
          ]
        },
        {
          "parameters": {
            "functionCode": "// Transform and filter rates\nconst threshold = 0.95;\nconst newRates = {};\n\nfor (const [currency, rate] of Object.entries($json[\"rates\"])) {\n  if (rate < threshold) {\n    newRates[currency] = {\n      rate: rate,\n      alert: true,\n      threshold: threshold\n    };\n  } else {\n    newRates[currency] = {\n      rate: rate,\n      alert: false,\n      threshold: threshold\n    };\n  }\n}\n\nreturn [{ json: { rates: newRates, timestamp: new Date().toISOString() } }];"
          },
          "name": "ProcessRates",
          "type": "n8n-nodes-base.function",
          "typeVersion": 1,
          "position": [
            650,
            300
          ]
        },
        {
          "parameters": {
            "conditions": {
              "boolean": [
                {
                  "value1": "={{ $json[\"rates\"][\"EUR\"].alert }}",
                  "operation": "equal",
                  "value2": true
                }
              ]
            }
          },
          "name": "CheckEURAlert",
          "type": "n8n-nodes-base.if",
          "typeVersion": 1,
          "position": [
            850,
            200
          ]
        },
        {
          "parameters": {
            "conditions": {
              "boolean": [
                {
                  "value1": "={{ $json[\"rates\"][\"GBP\"].alert }}",
                  "operation": "equal",
                  "value2": true
                }
              ]
            }
          },
          "name": "CheckGBPAlert",
          "type": "n8n-nodes-base.if",
          "typeVersion": 1,
          "position": [
            850,
            300
          ]
        },
        {
          "parameters": {
            "conditions": {
              "boolean": [
                {
                  "value1": "={{ $json[\"rates\"][\"JPY\"].alert }}",
                  "operation": "equal",
                  "value2": true
                }
              ]
            }
          },
          "name": "CheckJPYAlert",
          "type": "n8n-nodes-base.if",
          "typeVersion": 1,
          "position": [
            850,
            400
          ]
        },
        {
          "parameters": {
            "text": "={{ \"⚠️ EUR Alert! Rate dropped to \" + $json[\"rates\"][\"EUR\"].rate + \" (Threshold: \" + $json[\"rates\"][\"EUR\"].threshold + \")\" }}",
            "channel": "C1234567890",  // Replace with your Slack channel ID
            "options": {}
          },
          "name": "NotifyEURSlack",
          "type": "n8n-nodes-base.slack",
          "typeVersion": 1,
          "position": [
            1050,
            200
          ]
        },
        {
          "parameters": {
            "text": "={{ \"⚠️ GBP Alert! Rate dropped to \" + $json[\"rates\"][\"GBP\"].rate + \" (Threshold: \" + $json[\"rates\"][\"GBP\"].threshold + \")\" }}",
            "channel": "C1234567890",  // Replace with your Slack channel ID
            "options": {}
          },
          "name": "NotifyGBPSlack",
          "type": "n8n-nodes-base.slack",
          "typeVersion": 1,
          "position": [
            1050,
            300
          ]
        },
        {
          "parameters": {
            "text": "={{ \"⚠️ JPY Alert! Rate dropped to \" + $json[\"rates\"][\"JPY\"].rate + \" (Threshold: \" + $json[\"rates\"][\"JPY\"].threshold + \")\" }}",
            "channel": "C1234567890",  // Replace with your Slack channel ID
            "options": {}
          },
          "name": "NotifyJPYSlack",
          "type": "n8n-nodes-base.slack",
          "typeVersion": 1,
          "position": [
            1050,
            400
          ]
        },
        {
          "parameters": {
            "documentId": "your-google-sheet-id-here",  // Replace with your Google Sheet ID
            "sheetName": "ExchangeRates",
            "columns": "={{ [\"Timestamp\", \"Currency\", \"Rate\", \"Alert\"] }}",
            "rows": "={{ $json[\"rates\"] ? Object.keys($json[\"rates\"]).map(currency => [\n   $json[\"timestamp\"],\n   currency,\n   $json[\"rates\"][currency].rate,\n   $json[\"rates\"][currency].alert ? \"YES\" : \"no\"\n]) : [] }}",
            "options": {}
          },
          "name": "LogToGoogleSheets",
          "type": "n8n-nodes-base.googleSheets",
          "typeVersion": 1,
          "position": [
            850,
            500
          ]
        },
        {
          "parameters": {
            "level": "ERROR",
            "message": "Failed to fetch exchange rates. Please check the API configuration."
          },
          "name": "ErrorHandler",
          "type": "n8n-nodes-base.errorTrigger",
          "typeVersion": 1,
          "position": [
            650,
            500
          ],
          "alwaysOutputData": false
        }
      ],
      "connections": {
        "Scheduler": {
          "main": [
            [
              {
                "node": "FetchExchangeRates",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "FetchExchangeRates": {
          "main": [
            [
              {
                "node": "ProcessRates",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "ErrorHandler",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "ProcessRates": {
          "main": [
            [
              {
                "node": "CheckEURAlert",
                "type": "main",
                "index": 0
              },
              {
                "node": "CheckGBPAlert",
                "type": "main",
                "index": 0
              },
              {
                "node": "CheckJPYAlert",
                "type": "main",
                "index": 0
              },
              {
                "node": "LogToGoogleSheets",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "CheckEURAlert": {
          "main": [
            [
              {
                "node": "NotifyEURSlack",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "CheckGBPAlert": {
          "main": [
            [
              {
                "node": "NotifyGBPSlack",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "CheckJPYAlert": {
          "main": [
            [
              {
                "node": "NotifyJPYSlack",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      },
      "active": true,
      "settings": {
        "executionOrder": "v1"
      },
      "id": "currency-monitoring-system"
    }
    

    Key Features:

    1. Scheduled Trigger: Runs every 60 minutes
    2. API Integration: Fetches live currency rates from exchangerate.host
    3. Data Processing:
      • Custom JavaScript function for rate transformation
      • Threshold comparison (0.95 in this example)
      • Alert flagging system
    4. Conditional Alerting:
      • Separate checks for EUR, GBP, JPY
      • Parallel alert processing
    5. Multi-Platform Notifications:
      • Slack alerts for critical rate drops
      • Detailed alert messages with actual rates
    6. Data Logging:
      • Automatic logging to Google Sheets with timestamps
      • Records both alert and non-alert states
    7. Error Handling:
      • Dedicated error handling node
      • Failure detection for API requests

    Setup Instructions:

    1. Required Credentials:

      • Slack (for notifications)
      • Google Sheets (for logging)
    2. Replace Placeholders:

      • C1234567890 → Your Slack channel ID
      • your-google-sheet-id-here → Your Google Sheet ID
    3. Customization Points:

      • Adjust threshold in the Function node
      • Modify currencies in API URL
      • Change schedule interval
      • Update alert messages
    4. Google Sheet Setup:

      • Create sheet with columns: Timestamp | Currency | Rate | Alert
      • Name the sheet "ExchangeRates"
    5. Error Handling:

      • Connect ErrorHandler to your preferred notification method
      • Customize error messages as needed

    This workflow demonstrates enterprise-grade patterns including parallel processing, data transformation, error handling, and multi-platform integrations. The modular design allows easy extension to additional currencies or notification channels.

    To use: Save as .json file and import via n8n's UI. Remember to activate all required credentials before testing.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.