Skip to content

feat(automation): multi-environment n8n workflow deploy + admin SSO#65

Merged
boazpoolman merged 5 commits into
developfrom
feat/automation-multi-env-deploy
Jun 29, 2026
Merged

feat(automation): multi-environment n8n workflow deploy + admin SSO#65
boazpoolman merged 5 commits into
developfrom
feat/automation-multi-env-deploy

Conversation

@derrickmehaffy

Copy link
Copy Markdown
Member

What & why

Prepares the community moderation automation to run across multiple environments on a shared n8n instance (staging + production), plus admin SSO hardening. Follows up the contract-drift fixes that already merged in #59.

All workflow changes were validated end-to-end against a local Strapi + n8n + Mailpit harness on staging data (all 8 lifecycle events fire correctly), and the imported workflows are live on the staging n8n.

Changes

feat(cms): admin Google SSO restricted to @strapi.io + production provider config

  • Google passport strategy now rejects non-@strapi.io emails and passes the request to the callback.
  • Adds the equivalent provider config under config/env/production/admin.ts so it applies on Strapi Cloud.
  • Drops a dead @ts directive on the GoogleStrategy constructor (it suppressed no error and tripped biome's @ts-ignore@ts-expect-error rule, breaking check-types).

feat(cms/moderation): configurable n8n webhook path namespace

  • New N8N_WEBHOOK_NAMESPACE (default strapi) prefixes all lifecycle + security-scan webhook paths.
  • Lets duplicate workflow sets on one n8n instance listen on distinct, non-colliding paths: production Strapi → /webhook/strapi/…, staging Strapi → /webhook/staging/….
  • Mirrored into config/env/production/plugins.ts so it resolves on Strapi Cloud.

fix(automation): credential-based Strapi auth + pin node/n8n versions

  • Strapi-calling HTTP nodes now use an n8n Header Auth credential instead of an $env token (base URL is a per-instance literal); the Claude node uses the predefined Anthropic credential. No runtime env vars needed in n8n.
  • Pins httpRequest nodes to typeVersion 4.4 and the n8n image to n8nio/n8n:2.27.4 for version portability; removes the now-unused STRAPI_* / N8N_BLOCK_ENV_ACCESS_IN_NODE compose env.

docs(automation): per-instance deploy README

  • apps/automation/workflows/README.md: import, the post-import re-link of by-id references, the credentials + Strapi env vars per instance, the N8N_WEBHOOK_NAMESPACE scheme, and activation.

Deploy notes (per environment)

N8N_WEBHOOK_NAMESPACE Strapi posts to n8n set's webhook paths
Production strapi (or unset) /webhook/strapi/… strapi/…
Staging staging /webhook/staging/… staging/…

Per n8n set you bind 5 credentials (Strapi API Header Auth, Webhook Auth Header Auth, SendGrid, Slack, Anthropic) and set the Strapi base URL on the 9 Strapi nodes — see the README. Strapi side still needs N8N_WEBHOOK_BASE_URL / N8N_WEBHOOK_MODE=production / N8N_WEBHOOK_AUTH_HEADER / N8N_WEBHOOK_AUTH_VALUE and an API token. check-types passes.

🤖 Generated with Claude Code

derrickmehaffy and others added 4 commits June 25, 2026 12:42
…rovider config

Guard the Google passport strategy to only accept @strapi.io emails (reject others) and pass the request to the callback; mirror the Google provider config under config/env/production/admin.ts so it applies on Strapi Cloud. Drop an unnecessary @ts directive on the GoogleStrategy constructor (it suppressed no error and tripped the biome @ts-ignore->@ts-expect-error rule, breaking check-types).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add N8N_WEBHOOK_NAMESPACE (default "strapi") to prefix all lifecycle + security-scan webhook paths, so duplicate workflow sets sharing one n8n instance (e.g. staging vs production) post to distinct, non-colliding paths. Mirrored into config/env/production/plugins.ts so it resolves on Strapi Cloud.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switch the Strapi-calling HTTP nodes from $env token auth to an n8n Header Auth credential (Strapi base URL becomes a per-instance literal); the Claude node uses the predefined Anthropic credential. Pin httpRequest nodes to typeVersion 4.4 and the n8n image to 2.27.4 for version portability, and drop the now-unused STRAPI_*/N8N_BLOCK_ENV_ACCESS compose env (auth is credential-based now).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers import, the post-import re-link of by-id references, the n8n credentials + Strapi env vars per instance, the N8N_WEBHOOK_NAMESPACE multi-env scheme, and activation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
community-web Ready Ready Preview, Comment Jun 25, 2026 8:26pm

Request Review

deploy-workflows.mjs deploys a workflow set to a target n8n instance for one environment: rewrites the Strapi base URL (from the localhost placeholder) and webhook paths to the env namespace, re-links the by-id references (executeWorkflow->render-email, errorWorkflow->error-handler), and re-attaches existing credential bindings by node name so re-deploys don't wipe them. README documents the deploy flow + per-set credentials/env vars + base-URL handling (9 nodes across 4 workflows), and adds a mermaid architecture diagram (Strapi <-> n8n <-> SendGrid/Slack/Anthropic).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@boazpoolman boazpoolman merged commit 3fcd0b2 into develop Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants