Postgres Sales Dashboard With Period Comparison Via Webhook

    What this workflow does

    The workflow contains these steps: Run Once to Create Tables → Create Sales Tables → Add Demo Orders If Empty → Sales Dashboard Webhook → Weekly Report Schedule → Dashboard Settings → Validate Request → Request Valid? → Respond Bad Request → Load Sales Metrics → Browser Request? → Respond Database Unavailable → Fail Weekly Report Query → Build Report → Weekly Run? → Send Weekly Report Email → Fail Weekly Email → CSV Requested? → Respond CSV → Respond Dashboard.

    What you need

    • An n8n instance to import and run the workflow.
    • StickyNote access for the StickyNote steps listed in this workflow.
    • ManualTrigger access for the ManualTrigger steps listed in this workflow.
    • Postgres access for the Postgres steps listed in this workflow.
    • Webhook access for the Webhook steps listed in this workflow.
    • Schedule access for the Schedule steps listed in this workflow.
    • Set access for the Set steps listed in this workflow.
    • Code access for the Code steps listed in this workflow.
    • IF access for the IF steps listed in this workflow.
    • RespondToWebhook access for the RespondToWebhook steps listed in this workflow.
    • StopAndError access for the StopAndError steps listed in this workflow.
    • EmailSend access for the EmailSend steps listed in this workflow.

    Workflow nodes

    1. Run Once to Create Tables (n8n-nodes-base.manualTrigger)
    2. Create Sales Tables (n8n-nodes-base.postgres)
    3. Add Demo Orders If Empty (n8n-nodes-base.postgres)
    4. Sales Dashboard Webhook (n8n-nodes-base.webhook)
    5. Weekly Report Schedule (n8n-nodes-base.scheduleTrigger)
    6. Dashboard Settings (n8n-nodes-base.set)
    7. Validate Request (n8n-nodes-base.code)
    8. Request Valid? (n8n-nodes-base.if)
    9. Respond Bad Request (n8n-nodes-base.respondToWebhook)
    10. Load Sales Metrics (n8n-nodes-base.postgres)
    11. Browser Request? (n8n-nodes-base.if)
    12. Respond Database Unavailable (n8n-nodes-base.respondToWebhook)
    13. Fail Weekly Report Query (n8n-nodes-base.stopAndError)
    14. Build Report (n8n-nodes-base.code)
    15. Weekly Run? (n8n-nodes-base.if)
    16. Send Weekly Report Email (n8n-nodes-base.emailSend)
    17. Fail Weekly Email (n8n-nodes-base.stopAndError)
    18. CSV Requested? (n8n-nodes-base.if)
    19. Respond CSV (n8n-nodes-base.respondToWebhook)
    20. Respond Dashboard (n8n-nodes-base.respondToWebhook)
    StickyNoteManualTriggerPostgresWebhookScheduleSetCodeIFRespondToWebhookStopAndErrorEmailSend
    25 nodesData Processing
    View on GitHub

    Need this workflow customized or debugged? Book a 30-min scope call →

    Want this set up for you? Book a 30-min scope call

    I build and fix n8n workflows for agencies and SaaS teams. 30-minute scope call — bring the problem, leave with an estimate.

    Related workflows