infrastructure_roadmap

This is an old revision of the document!


For Crowdfunding Campaign

View our project for more details.

Infrastructure we still need: * Campaign Website

Ecosystem Overview

  • n8n: Orchestrates the automations and connects all systems.
  • Stripe: Captures payments (Checkout) and emits webhooks.
  • Shopware: Store backend where VIP promotion codes/coupons are created.
  • Mautic: Marketing automation/CRM; stores contacts, fields, and sends emails.
  • Discord: Community platform; API used to generate single-use invite links.
  • EspoCRM: Sales CRM; leads are ensured/created for marketing contacts.

Workflow 1: Mautic Contact Updated → Discord Invite(s) → Mautic + EspoCRM Sync → Invite Email

Purpose: When a Mautic contact is updated and has opted in, this workflow issues the correct Discord invite (VIP or Basic), saves the link on the Mautic contact, ensures a Lead exists in EspoCRM, and emails the invite. It includes jitter and “already has a link?” checks to prevent duplicates.

  • Unordered List ItemTrigger: Mautic “Contact Updated”
  • Wait 0–3s (jitter to reduce concurrent updates)
  • Check if “opt_in_confirmed” is true; otherwise, stop
  • If “vip_status” is true:
    • Unordered List Item* Check if VIP Discord invite link exists
    • If not, wait 0.3–1.2s, re-fetch contact, check again
    • If still missing, issue VIP Discord invite link (via Discord API)
    • Update Mautic contact with discord_invite_link_vip
    • Check if link was successfully added
    • Send VIP Discord invite email to contact (from Mautic)
  • Else (non-VIP):
    • Check if Basic Discord invite link exists
    • If not, wait 0.3–1.2s, re-fetch contact, check again
    • If still missing, issue Basic Discord invite link (via Discord API)
    • Update Mautic contact with discord_invite_link_basic
    • Check if link was successfully added
    • Send Basic Discord invite email to contact (from Mautic)
  • EspoCRM Sync:
    • Try to retrieve Lead by contact attributes (typically email)
    • If not found, create Lead in EspoCRM (via HTTP POST)

Outputs & Side Effects

  • Unordered List ItemMautic contact has exactly one stored Discord invite link (VIP or Basic).
  • Appropriate invite email is sent from Mautic.
  • A corresponding Lead exists in EspoCRM.

Workflow 2: Stripe → VIP Coupon → Mautic Update → Coupon Email

Purpose: When a customer successfully purchases a “VIP reservation” via Stripe, this workflow generates a unique Shopware coupon, marks the buyer as VIP in Mautic, and sends the coupon by email.

  • Trigger: Stripe webhook on checkout.session.completed
  • Check if payment was successful
  • Look up session in Stripe to get line items
  • If the product was a VIP reservation, continue; otherwise, stop
  • Generate promo code (unique for each purchase)
  • Add promo code to VIP promotion in Shopware (via HTTP POST)
  • Find corresponding contact in Mautic (by email)
  • Merge promo code and contact details
  • Set contact “vip_status” to true and assign promo code in Mautic
  • Send email with coupon to contact (from Mautic)

Outputs & Side Effects

  • A new single-use promo code is created in Shopware’s VIP promotion.
  • The buyer’s Mautic contact is marked as VIP and stores the promo code.
  • Coupon email is sent from Mautic.
  • Only runs for successful payments and only for the VIP product.
  • Contact matching uses the email captured by Stripe.
  • If the Shopware API call fails, the Mautic update/email won’t run (prevents partial state).
  • Unordered List Itemvip_status: boolean
  • promo_code: string (from Workflow 1)
  • discord_invite_link_vip / discord_invite_link_basic: strings
  • opt_in_confirmed: boolean (gate for all messaging)
  • Credentials needed: Stripe (API + webhook secret), Mautic API + email config, Shopware API token, Discord Bot token, EspoCRM API credentials.
  • Respect Discord rate limits; n8n waits help mitigate 429s.
  • To reissue an invite, clear the relevant invite link field in Mautic and save; the workflow will create a new link.
  • Troubleshooting: Shopware errors stop coupon issuance; Mautic update failures prevent emails; duplicate invites usually mean a field name mismatch or a parallel process overwriting values.
  • infrastructure_roadmap.1755628108.txt.gz
  • Last modified: 2025/08/19 18:28
  • by cornelius.reyneke