Run a step function to add newly created users to all external systems at once
npx inngest-cli init --template github.com/inngest/inngest#examples/account-federation-step-function
This function responds to an auth/account.created
event sent when a new user signs up, then adds
the user to several external systems and sends a message in slack - in real-time.
auth/account.created
event is sent to InngestUsing step functions to add users to external systems (user federation) provides a few benefits:
Use this quickstart with a single CLI command to get started! The CLI will then guide you through running, testing, and deploying to Inngest Cloud.
Via the CLI:
inngest init --template github.com/inngest/inngest#examples/account-federation
Via NPX:
npx inngest-cli init --template github.com/inngest/inngest#examples/account-federation
With the function cloned, run inngest run
to test the function locally.
This function has several steps within steps/
. Each step runs in parallel independently of each
other.
In this example, all steps are Typescript functions which implement 3rd party APIs for creating
users in external systems. You can use any language in steps and integrate any APIs you need.
Below is the annotated function definition (found at inngest.json) to show how the above is defined in config.
{
"$schema": "https://raw.githubusercontent.com/inngest/inngest/main/schema.json",
"name": "Add new users to external systems",
"description": "Run a step function to add newly created users to all external systems at once",
"tags": ["typescript", "auth", "step function"],
"id": "gentle-katydid-de85f5",
"triggers": [
{
"event": "auth/account.created",
"definition": {
"format": "cue",
"def": "file://events/auth-account-created.cue"
}
}
],
"steps": {
"add-to-intercom": {
"id": "add-to-intercom",
"path": "file://steps/add-to-intercom",
"name": "Add to intercom",
"runtime": { "type": "docker" },
"after": [{ "step": "$trigger" }]
},
"send-to-slack": {
"id": "send-to-slack",
"path": "file://steps/send-to-slack",
"name": "Send to slack",
"runtime": { "type": "docker" },
"after": [{ "step": "$trigger" }]
},
"add-to-close-io": {
"id": "add-to-close-io",
"path": "file://steps/add-to-close-io",
"name": "Add to Close.io",
"runtime": {
"type": "docker"
}
}
}
}