n8n: AI automation, AI support agents and integration middleware
n8n: AI automation, AI support agents and integration middleware
What it is
n8n is an external workflow automation platform that 3B Onboarding is designed to
work alongside. It is not part of the managed package, and this article does not
cover installing or building n8n workflows node by node. Instead it explains the
three roles n8n plays in a 3B Onboarding rollout, and how to wire each role to the
objects, fields, components and metadata you already have in your Salesforce org.
The three roles are:
- AI automation platform: orchestrate LLM-driven steps in onboarding and
credentialling (summarise a candidate's documents, extract data from an uploaded
certificate, draft a compliance decision for a specialist to approve).
- AI support-agent platform: power the AI Agent Chat and AI Form
components that 3B Onboarding embeds in candidate portals, so a candidate can ask
"what documents do I still need?" and get an answer grounded in org data.
- Integration middleware: sit between Salesforce and external systems (job
boards, ATS, background-check and credential-verification providers, e-sign,
messaging/WhatsApp/email) so 3B Onboarding stays the system of record while n8n
moves data in and out.
Across all three, the design principle is the same: Salesforce (3B Onboarding) is
the system of record; n8n is the moving parts around it. Candidate state,
document packs, requested documents, compliance items and certificates live in
Salesforce. n8n reacts to them, enriches them, or feeds external systems from them.
This matters for the verticals 3B Onboarding serves. Healthcare, Education and
Blue-Collar staffing all depend on repeated, time-boxed checks against third-party
systems and on chasing candidates for the right evidence. That is exactly the work
n8n is good at automating.
The problem it solves
3B Onboarding models the credentialling lifecycle well: document packs, conditional
requested documents, compliance requirements, certificates and expiry. But a real
staffing operation also has to:
- Reach outside Salesforce to verify or fetch evidence (right-to-work checks, DBS /
background checks, licence and ticket registries, qualification lookups).
- Push candidate and placement data out to job boards, an ATS, or a messaging
channel, and pull results back in.
- Answer the same candidate questions over and over ("which documents are still
outstanding", "when does my certificate expire", "how do I upload my ticket").
- Do bounded AI work on unstructured evidence (read a scanned certificate, pull out
the expiry date, propose a compliance status) without hard-coding brittle parsers.
Salesforce Flow can do some of this, but it is not the right tool for long-running,
many-step, retry-heavy calls to flaky external APIs, and it is not where you want to
host LLM prompt logic or hold third-party credentials. n8n absorbs that
responsibility and keeps Salesforce clean.
Who uses it
- System integrator / admin: configures the n8n endpoint, builds the
workflows, and wires the outbound and inbound integration points. This is the
primary audience for this article.
- Compliance specialist: benefits from AI-drafted decisions and from having
external check results written straight back onto compliance items, but interacts
only with Salesforce.
- Recruiter: benefits from candidate data flowing to and from job boards / ATS.
- Candidate: talks to the AI Agent Chat / AI Form support agent in the portal,
and never sees n8n directly.
How n8n connects to 3B Onboarding today
3B Onboarding already ships two native components that are backed by an n8n
endpoint, plus an org-level setting that points at it.
The org-level endpoint setting
| Object |
Field |
Type |
Purpose |
b3o__Onboarding_Default_Settings__c (custom setting) |
b3o__N8N_Endpoint__c |
URL |
Base URL of your n8n instance. Injected into the host pages as the AI endpoint. Default value ships as https://n8n.3bapi.com; set this to your own n8n instance. |
b3o__Onboarding_Default_Settings__c |
b3o__Site_URL__c |
URL |
Site / portal base URL used by the host pages. Must be populated or the host page will warn on load. |
Set b3o__N8N_Endpoint__c once, per org, to the base URL of the n8n instance you
control. Every embed reads from it, so you do not repeat the URL per component.
The AI Agent Chat component
- Master label:
AI Agent Chat (native LWC).
- Placement targets: Lightning record page, Experience / Community page,
utility bar, and (as a portal block) a 3B Portals page.
- Host page: the
AIChatComponent Visualforce page (browser title "Agent").
- Portal block:
AI Chat Component, web-component tag ai-chat-component,
category Interactions.
Design properties you set when you drop the native component onto a page:
| Property |
Required |
What it does |
chatId |
Yes |
The Chat ID of the AI Agent workflow in n8n. This selects which n8n workflow answers the conversation. |
themeType |
Yes |
Visual theme (light, dark, and other named themes). |
height |
Yes |
Component height in pixels. |
title / subtitle |
No |
Header text. |
initialMessage |
No |
A pre-set opening message from the agent. |
inputPlaceholder |
No |
Placeholder text in the message box. |
allowFileUploads |
No |
Whether the candidate can attach files to the conversation. |
allowedFilesMimeTypes |
No |
Comma-separated list of accepted MIME types. |
When surfaced through the AI Chat Component portal block, the same values are set
as block traits, plus context traits the portal fills in automatically:
record-id (defaults to the portal contact, {{contactUser.Id}}), object-name
(default Contact), action-name (default portal_chat), and ai-endpoint
(defaults to the n8n base URL).
- Master label:
AI Form (native LWC).
- Placement targets: Lightning record page, Experience / Community page,
utility bar, and (as a portal block) a 3B Portals page.
- Host page: the
AIFormComponent Visualforce page (browser title "Form").
- Portal block:
AI Form Component, web-component tag ai-form-component.
Design properties:
| Property |
Required |
What it does |
formId |
Yes |
The production Form ID from n8n. Selects which n8n form workflow drives the experience. |
themeType |
Yes |
Visual theme. |
height |
Yes |
Component height in pixels. |
How the embed reaches n8n
Both components point at your n8n base URL (b3o__N8N_Endpoint__c) and use the
chatId / formId to select the specific workflow. The candidate's browser talks
to the n8n webhook for that workflow; the AI Agent Chat conversation posts to a
webhook path derived from the base URL and the Chat ID. Every request carries a
small block of context metadata so the workflow knows who and what the
conversation is about:
userType, userId, orgId: who is talking and from which org.
recordId, objectName: the record the component is scoped to (usually the
candidate Contact).
actionName: a label identifying the interaction (for example portal_chat).
- session context (see security below) so a guest conversation is tied to a
specific, server-pinned contact.
That context is what lets an n8n workflow answer "what documents do I still need?":
it takes the recordId (the candidate contact), queries Salesforce for that
contact's requested documents / compliance items, and composes an answer.
Example: candidate context sent to an AI agent
The payload below is illustrative only. It shows the shape of the context that
accompanies a candidate message so an n8n workflow can ground its answer in org
data. Do not treat field names here as guaranteed API names; treat them as the kind
of context available.
{
"action": "sendMessage",
"chatId": "onboarding-help",
"message": "What documents do I still need to upload?",
"metadata": {
"userType": "Guest",
"userId": "005XXXXXXXXXXXXXXX",
"orgId": "00DXXXXXXXXXXXXXXX",
"objectName": "Contact",
"recordId": "003XXXXXXXXXXXXXXX",
"actionName": "portal_chat",
"sessionContext": "<session-context>"
}
}
A grounded response from the workflow might look like this. The workflow, not the
browser, has done the Salesforce lookup and any LLM call:
{
"reply": "You have 2 documents outstanding: your DBS certificate and your right-to-work evidence. Your first-aid certificate is on file and approved. Would you like the upload link for the DBS certificate?",
"grounding": {
"outstandingCount": 2,
"requestedDocuments": ["DBS Certificate", "Right to Work Evidence"],
"completedDocuments": ["First Aid Certificate"]
},
"suggestedActions": [
{ "label": "Upload DBS certificate", "actionName": "open_document", "recordId": "a0XXXXXXXXXXXXXXXX" }
]
}
The important point: the candidate's browser never queried Salesforce directly and
never held Salesforce credentials. It sent a message plus signed session context;
n8n did the privileged work.
The two integration directions
Beyond the embedded AI components, n8n as middleware works in both directions.
Salesforce to n8n (outbound)
Trigger an n8n workflow from something that happens in the org:
- Flow HTTP Callout action: call an n8n webhook from a record-triggered or
scheduled Flow. This is the simplest and most common outbound path. Use a Named
Credential for the n8n base URL so the endpoint and any auth header are managed in
Setup, not hard-coded in the Flow.
- Platform Events: publish an event from Apex or Flow and have n8n subscribe.
Good for high-volume, decoupled, "fire and forget" signals.
- Outbound Messages: the classic workflow-driven SOAP outbound message to a
webhook, when you want guaranteed retry semantics without writing Apex.
- Invocable Apex / callable Apex: where you need to assemble a richer payload
(for example, gather a candidate's requested documents and compliance items before
calling out), expose an invocable action that performs the HTTP callout and drop it
into a Flow. 3B Onboarding already exposes invocable actions such as
"3B Recalculate Requested Documents" and "3B Recalculate Compliance"; the same
pattern (invocable action in a Flow) is how you would trigger an n8n callout with
onboarding context attached.
Typical outbound triggers in staffing:
- A
b3o__Document_Submission__c is created with a new certificate → call n8n to
run a verification / OCR workflow.
- A compliance item flips to
Expired (the daily sweep does this on real fields) →
call n8n to send a revalidation reminder over the candidate's preferred channel.
- A placement is confirmed → call n8n to push the candidate to a job board or ATS.
n8n to Salesforce (inbound)
Have n8n write results back into 3B Onboarding:
- Salesforce API: n8n authenticates to Salesforce (Connected App / OAuth,
credentials stored in n8n) and writes records directly: create a
b3o__Document_Submission__c, update a certificate, set a field that a compliance
auto-check rule reads, or update the candidate Contact.
- Product remoting endpoints: where you want the same server-side rules and
access model the front-end apps use, n8n can call the product's remoting contract
(controller name plus an
endp action) for the supported endpoints rather than
raw record DML. See the
Developer and API reference for the
request shape, response contract and supported endpoints.
- Re-trigger recalculation: after writing evidence back, call the invocable
"3B Recalculate Requested Documents" or "3B Recalculate Compliance" (or let the
triggers do it) so the visible state and rollup counts stay correct.
Both engines are idempotent and safe to re-run, which is exactly what you want an
external system calling in to rely on.
Concrete staffing examples
Healthcare
- Right-to-work and DBS / background checks: on submission, n8n calls the provider,
polls for the result, then writes a certificate or updates a compliance-item field
back in Salesforce so the compliance auto-check rule resolves the status.
- Revalidation reminders: when a compliance item expires, n8n messages the candidate
and the recruiter and reopens the requirement.
Education
- Safeguarding checks: n8n orchestrates the safeguarding / enhanced-check provider
and records the outcome as evidence against the relevant compliance requirement.
- Reference collection: n8n chases referees by email, collects responses, and files
them as document submissions.
Blue-Collar
- Ticket / licence expiry: n8n watches for approaching expiry on certificates and
drives renewal reminders and re-upload requests; when the new ticket is verified it
writes the refreshed expiry back so the compliance item returns to
Compliant.
- Skills registry lookups: validate a licence number against an external registry and
attach the result as evidence.
In every case, 3B Onboarding holds the authoritative record (document pack, requested
documents, compliance items, certificates) and n8n does the outside work.
When to reach for n8n vs native Salesforce Flow
Use Flow when the work is:
- Entirely inside Salesforce (field updates, record creation, rollups, rule-driven
visibility).
- A single, reliable callout with simple logic.
- Something admins should own and maintain declaratively in the org.
Reach for n8n when the work is:
- Multi-step or long-running across external systems, with polling, retries and
branching.
- AI / LLM work, or parsing of unstructured evidence, where the prompt logic and
model provider should live outside Salesforce.
- Integration with many third parties, where you want the credentials and the
API-specific quirks contained in one place, not spread across Flows.
- A candidate-facing conversational or form experience (the AI Agent Chat and
AI Form components are explicitly n8n-backed).
A good default: keep the decision and the record state in Salesforce; keep the
orchestration, the external calls and the AI in n8n.
Recommended patterns
- Keep credentials in n8n, never in the browser. Third-party API keys and the
LLM provider credentials live in n8n. The embedded components send a message plus
signed session context, nothing privileged. On the Salesforce side, store the n8n
base URL and any auth header behind a Named Credential.
- Rely on the session-key model for guest conversations. The AI Agent Chat and
AI Form components run in portals and Experience pages where the candidate may be a
guest. Guest access requires a valid session key, and a guest can act only for the
contact that key identifies. Treat the session context in
the payload as short-lived and signed, and have your n8n workflow resolve the
candidate from it rather than trusting any contact id the browser might assert on
its own.
- Log every automation run. Give each workflow execution a correlation id and
record what it did, ideally back in Salesforce (an activity, a note, or a custom
log record) so specialists can see why a compliance item changed.
- Make automations idempotent. External calls get retried and events get
redelivered. Use stable keys (for example, upsert evidence by a deterministic
external id) so a re-run does not create duplicates. This mirrors how the product's
own requested-documents and compliance engines are built.
- Let AI draft, let a human approve. For compliance decisions, have n8n propose a
status or extract a value and stage it for a specialist to approve in the console.
Do not let an automation silently mark a candidate compliant. Status derivation and
approval stay governed by the product's own rules.
- Stay vendor-neutral on the model. The LLM provider is an n8n concern; the
Salesforce side does not care which model answers, only that grounded, auditable
results come back.
Access and permissions
- The AI Agent Chat and AI Form components are session apps: authenticated internal
and community users are resolved from their user / contact and run with full
CRUD / FLS / sharing enforcement; guests need a valid session key
and can act only for the contact it identifies.
- Any new objects or fields you add to support an n8n integration (for example a
custom automation-log object, or new fields the workflows read and write) must be
granted on the
Onboarding_Admin_Full_Permission permission set.
- The n8n endpoint itself enforces its own access; the session key gates the
Salesforce-side access, and the browser never holds org credentials.
b3o__Onboarding_Default_Settings__c: holds b3o__N8N_Endpoint__c (the n8n base
URL) and b3o__Site_URL__c.
Contact: the usual conversation / integration context record; its id travels to
n8n as the candidate reference.
b3o__Document_Submission__c, b3o__Requested_Document__c,
b3o__Compliance_Item__c, certificate records: the onboarding state an n8n
workflow reads to ground an answer and writes back to when evidence is verified.
Related articles