How n8n fits in
The two automations, which way data flows, and why credentials stay in n8n.
n8n is an open-source workflow tool. Both social modules expose webhooks so an n8n instance can do two things Odoo does not do by itself:
- AI content generation. A user presses Generate with AI on a post. SmartERP asks n8n, n8n asks an AI model (for example Claude) to draft the message and hashtags, and n8n sends the result back to the post.
- Auto-publish across all platforms. n8n polls SmartERP for due posts, calls each platform's real API and reports the result back.
ββββββββββββββββββββββββββββββββ
User clicks β n8n: ai-content-generation β
"Generate with β Webhook β Claude API β β
AI" on a post ββββΊ β POST result back to Odoo β
ββββββββββββββββββββββββββββββββ
β
βΌ
Odoo: post (message and hashtags updated, AI Content = received)
ββββββββββββββββββββββββββββββββ
Every 15 min βββββΊ β n8n: auto-publish β
β GET due posts from Odoo β β
β call each platform's API β β
β POST result back to Odoo β
ββββββββββββββββββββββββββββββββ
β
βΌ
Odoo: post (state = published / failed, error message updated)
Why publish from n8n#
Odoo never calls a platform directly for real publishing in this design. That stays in n8n, where you manage platform credentials in n8n's own credential store (OAuth2, header auth and so on) instead of storing long-lived tokens in Odoo.
Authentication#
Both directions use one shared API key, not an Odoo login:
- n8n sends it as the
X-Api-Keyheader on every call to SmartERP's webhooks. - SmartERP includes it in the body when it calls n8n, so the workflow can send it back on its callback.
The key is compared in constant time. If no key is configured, every webhook call is refused. Use HTTPS only. See Credentials and security.
Two modules, two sets of routes#
| Social Media Marketing Automation | AI Growth Workforce | |
|---|---|---|
| Route prefix | /social_media/webhook/ | /social_ai/webhook/ |
| Settings | Social Marketing β Configuration β Automation Settings | Settings β Technical β System Parameters |
| Key parameter | social_media_marketing_automation.api_key | social_media_ai_workforce.api_key |
| Webhook URL parameter | social_media_marketing_automation.n8n_ai_webhook_url | social_media_ai_workforce.ai_webhook_url |
The full route list is in the Webhook API.
Important
The two ready-made workflows in the repository's n8n/workflows/ folder are written for Social Media Marketing Automation: they call /social_media/webhook/... and read fields such as platform and account_handle. For the AI Growth Workforce, the routes and payloads differ, so the workflows need adapting. Each workflow page lists exactly what to change.
Get started#
- Webhook API: the routes and payloads.
- AI content workflow: import and connect it.
- Auto-publish workflow: import and connect it.