When deploying auth0 config with deploy cli tool the action does not get bound to the flow. It needs to be manually dragged in the dashboard to the login flow.
Is there a way to get the action automatically added to the login flow?
The config is in json file auth0-config/actions/post-login-action.json
{
"name": "post-login-action",
"code": "post-login-action.js",
"runtime": "node16",
"status": "built",
"dependencies": [
{
"name": "node-fetch",
"version": "2.6.1"
}
],
"secrets": [
...
],
"supported_triggers": [
{
"id": "post-login",
"version": "v2"
}
],
"deployed": true
}
1 Like
I am facing the same problem today. I want to add an action to the pre-user-registration
flow. Were you able to figure out a fix for this, @mhautala ?
I also attempted doing this in yaml syntax as suggested at Auth0-deploy-cli yaml configuration: Add an action to a flow but that doesn’t even create the action, let alone deploy and then add to the action.
Any suggestions, anybody?
Hey @mhautala and @abhilash.gupta.
Thanks for your contribution to our Community. I believe your questions have not been answered in detail so I have come to elaborate with an example.
I can see my colleague Dan has detailed how to do this with YAML here but there were no direct examples for JSON. Please see below for a JSON/directory example.
Using @mhautala 's example above let’s assume we have the following config file in the directory auth0-config/actions/post-login-action.json:
{
"name": "post-login-action",
"code": "post-login-action.js",
"runtime": "node16",
"status": "built",
"dependencies": [
{
"name": "node-fetch",
"version": "2.6.1"
}
],
"secrets": [
],
"supported_triggers": [
{
"id": "post-login",
"version": "v2"
}
],
"deployed": true
}
The corresponding code file is in the same directory as above with filename post-login-action.js
exports.onExecutePostLogin = async (event, api) => {
};
Finally the actual binding to flow is called a ‘trigger’. This file is located in the directory: /auth0-config/triggers/triggers.json (please note that the ‘action_name’ needs to match the ‘name’ of the action as defined above, the ‘display_name’ can be set to change the name on the actual flow)
{
"post-login": [
{
"action_name": "post-login-action",
"display_name": "post-login-action"
}
]
}
I did that and it works but now I want to make a test rollback and let only the original hook, this is what I did:
- I remove the actions from the triggers file
- I change the status to the actions to built and the deployed to false
but the actions kept appearing in the flow (just in case, the allow delete property is already set to true just for the specific tenant)
Hey team! 
Since this topic touches Auth0 Actions, quick heads-up that we’re hosting an Ask Me Anything dedicated to Actions with Gaston Danilo Asis Sanchez, Senior Technical Product Manager. We’ll cover practical usage, new capabilities like Transaction Metadata and Actions Types, plus a peek at what’s next. 
- Submit questions now through Aug 26

- Get detailed written answers live on Aug 27, 9–11 AM PT

Earn community points + a badge
. If you’re exploring how Actions can streamline your auth flows, this is a great time to get direct guidance from the team.
Join the AMA & drop your questions here: August 27 Auth0 Community Ask Me Anything: Actions
Dawid