Skip to main content

Handle order status webhooks with Microsoft SQL Server and email

Workflow preview

Workflow preview
100%
Handle order status webhooks with Microsoft SQL Server and email preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow receives order status updates via a webhook, validates and normalizes the payload, routes by status, and either returns an immediate JSON response or (for rejections) l...

Best for

  • CRM automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.if, n8n-nodes-base.respondtowebhook, n8n-nodes-base.set, n8n-nodes-base.switch, n8n-nodes-base.emailsend, n8n-nodes-base.webhook, n8n-nodes-base.microsoftsql

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Prakash Software.

Original n8n.io source

1.1 Workflow description

Title
Handle order status webhooks with Microsoft SQL Server and email
Workflow name
Handle order status webhooks with Microsoft SQL Server and email

Quick Overview

This workflow receives order status updates via a webhook, validates and normalizes the payload, routes by status, and either returns an immediate JSON response or (for rejections) logs activity to Microsoft SQL Server and sends a rejection email via SMTP.

How it works

  1. Receives a POST request with an order status update through an n8n webhook.
  2. Validates that email, orderId, and newStatus are present and returns a 400 JSON error response if any required fields are missing.
  3. Normalizes the payload into consistent fields (including a timestamp and formatted rejection reason) and routes processing based on newStatus.
  4. For Approved, Pending, and Completed statuses, returns a 200 JSON response confirming the status handling.
  5. For Rejected status, generates an HTML rejection email, inserts rejection and email logs into Microsoft SQL Server, sends the email via SMTP, and returns a 200 JSON success response.

Setup

  1. Enable the webhook trigger and set the webhook path, then copy the production webhook URL into the system that sends order status updates.
  2. Add Microsoft SQL Server credentials and ensure the ActivityLogs and EmailLogs tables (and referenced columns) match the INSERT queries used by the workflow.
  3. Add an SMTP/email credential for the email-sending step and set the fromEmail address to a valid sender.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Validate Payload

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 9 - Error Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 10 - Format Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Route By Status

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 12 - Approved Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 13 - Prepare Rejection Email

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Send Rejection Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 15 - Pending Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 16 - Completed Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 17 - Order Status Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 18 - Log Rejection

Type / Role
n8n-nodes-base.microsoftSql - microsoftSql
Config choices
Version 1.1

Block 19 - Rejection Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

3. Summary Table

Workflow Handle order status webhooks with Microsoft SQL Server and email
Complexity advanced
Nodes 19
Categories CRM
Author Prakash Software
Published 12 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16294/16294.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Handle order status webhooks with Microsoft SQL Server and email do?

Quick Overview This workflow receives order status updates via a webhook, validates and normalizes the payload, routes by status, and either returns an immediate JSON response or (for rejections) l...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM use case.