SmartERP Documentation An Ashewa Technology Solutions Platform

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:

  1. 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.
  2. 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-Key header 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 AutomationAI Growth Workforce
Route prefix/social_media/webhook//social_ai/webhook/
SettingsSocial Marketing β†’ Configuration β†’ Automation SettingsSettings β†’ Technical β†’ System Parameters
Key parametersocial_media_marketing_automation.api_keysocial_media_ai_workforce.api_key
Webhook URL parametersocial_media_marketing_automation.n8n_ai_webhook_urlsocial_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#

  1. Webhook API: the routes and payloads.
  2. AI content workflow: import and connect it.
  3. Auto-publish workflow: import and connect it.
Last updated: 2026-10-16