Build Actions Flows - Beta
To build an Actions flow, you must choose a flow, create an Action and configure it, and bind it to the flow.
Choose flows
Begin by choosing the flow to which you want to add Actions.
Navigate to Auth0 Dashboard > Actions > Flows.
Choose your flow.
You will see the Flow editor, which consists of:
Flow visualizer: Visual representation of the chosen flow’s pipeline.
Actions collection: Collection of deployed Actions, which you can search through and add to your flow.
Create Actions
Create an Action to add to your chosen flow.
In the Actions collection, select Create.
Enter a Name for your Action, and select Create. The correct trigger will be inferred from the chosen flow.
The Actions editor will open, containing a draft version of your Action.
Configure Actions
When you create or edit an action, you will see the Actions editor, which allows you to write the code for your Action, as well as define secrets and dependencies.
Define secrets
Actions feature integrated secret management to securely store secrets while making them conveniently available in code. Secrets are tied to Action versions, so any secrets saved will be remembered in drafts.
In the Actions editor, click the key icon to open the Secrets panel.
To add a secret, select Add Secret.
Enter a descriptive key name and value for your secret, and click Save.
Once a secret has been defined, you can:
Edit (pencil icon): Change the value of the secret. Once a secret has been saved, it will be read-only; you will no longer be able to view its value.
Delete (trash icon): Fully remove the secret from the server.
Define dependencies
Actions allow you to leverage the rich ecosystem of Node.js modules that are contained in the npm registry.
In the Actions editor, click the building block icon to open the Dependencies panel.
Click Add Module.
Enter the Name and Version of your module, and select Create.
Once a dependency has been defined, you can:
Edit (pencil icon): Change the name and version of the module.
Delete (trash icon): Remove the dependency from the Action.
Add code
The Actions code editor incorporates features of the TypeScript language server (but does not require code to be authored in TypeScript). This is provided to help you learn more about the code you're using, keep track of the parameters you're typing, and easily add calls to properties and methods.
In addition, in-editor code analysis identifies potential errors in code. For example, if you’ve removed a secret that your code still references, the code editor will identify references to the missing secret. To disable specific warnings in the editor, place a //@ts-ignore
comment on the line prior to where a warning is being displayed.
Type the code for your Action in the code editor. You can reference any properties contained within the Actions Context Object and Actions Event Object. For ideas, see example Actions Blueprints.
Select Deploy to add to the collection of available actions for flows. Alternatively, you can Save Draft to save the Action, then return to edit and deploy it later.
Bind Actions
The final step in building an Action flow is to bind your Actions to your chosen flow.
Navigate to Auth0 Dashboard > Actions > Flows.
Choose your flow.
Drag your Action from the Actions collection and drop it onto the flow visualizer, then select Save. You can add multiple Actions to the flow’s pipeline and arrange their order using drag-and-drop.
Click Apply to create the binding. Once applied, all changes are live.