# N8n CLI workflows not activating

**URL:** <https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295>\
**Category:** Questions\
**Tags:** deployment, cli\
**Created:** [June 19, 2023, 10:56pm UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295 "2023-06-19T22:56:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_C](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tim_c/32/22639_2.png) [@Tim\_C](https://community.n8n.io/u/Tim_C)\
**Post date:** [June 19, 2023, 10:56pm UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295/1 "2023-06-19T22:56:36Z")

</div>

## Describe the problem/error/question

When running  
n8n update:workflow --all --active=true  
I get this output:  
Deactivating all workflows

## What is the error message (if any)?

```auto
docker-n8n-1 | UserSettings were generated and saved to: /home/node/.n8n/config
docker-n8n-1 | Migrations in progress, please do NOT stop the process.
docker-n8n-1 | Migrations finished.
docker-n8n-1 | Successfully imported 3 credentials.
docker-n8n-1 | Importing 30 workflows...
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Deactivating workflow "-SNIP-" during import, remember to activate it later.
docker-n8n-1 | Successfully imported 30 workflows.
docker-n8n-1 | Deactivating all workflows
docker-n8n-1 | Done
docker-n8n-1 | License manager not initialized
docker-n8n-1 | n8n ready on 0.0.0.0, port 5678
docker-n8n-1 | Initializing n8n process
docker-n8n-1 | Version: 0.233.0
docker-n8n-1 | 
docker-n8n-1 | Editor is now accessible via:
docker-n8n-1 | http://localhost:5678/

```

## Please share your workflow

n/a - 30 workflows

## Share the output returned by the last node

## Information on your n8n setup

- **n8n version:** 0.233.0
- **Database (default: SQLite):** SQLite
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):** queue
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** docker
- **Operating system:** ubuntu

## Compose file

```auto
  n8n:
    image: n8nio/n8n:0.233.0
    restart: always
    environment: 
        - EXECUTIONS_MODE=queue
        - QUEUE_BULL_REDIS_HOST=redis
        - QUEUE_HEALTH_CHECK_ACTIVE=true
        - NODE_OPTIONS="--max-old-space-size=8192"
        - GENERIC_TIMEZONE=${N8N_TIMEZONE:?timezone is not set in .env}
        - EXECUTIONS_DATA_PRUNE=true
        - EXECUTIONS_DATA_MAX_AGE=24
        - EXECUTIONS_DATA_PRUNE_MAX_COUNT=500
        - EXECUTIONS_DATA_SAVE_ON_ERROR=all
        - EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
        - EXECUTIONS_DATA_SAVE_ON_PROGRESS=false
        - EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
        - NODE_FUNCTION_ALLOW_BUILTIN=* 
        - NODE_FUNCTION_ALLOW_EXTERNAL=moment,crypto-js
        - PUBLIC_URL=${PUBLIC_URL}
    volumes:
        - ./data/n8n/config:/home/node/.n8n/config        
        - ./data/workflows:/workflows #this has a bunch of workflow json files in it
        - ./data/credentials:/credentials #this has a bunch of credential json files in it
    command:
      - /bin/sh
      - -c
      - |
        /usr/local/bin/n8n import:credentials --separate --input=/credentials/ &&
        /usr/local/bin/n8n import:workflow --separate --input=/workflows/ &&
        /usr/local/bin/n8n update:workflow --all --active=true &&
        /usr/local/bin/n8n start

```

---

<div class="post-metadata">

**Author:** ![Tim\_C](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tim_c/32/22639_2.png) [@Tim\_C](https://community.n8n.io/u/Tim_C)\
**Post date:** [June 19, 2023, 10:59pm UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295/2 "2023-06-19T22:59:28Z")

</div>

> [@Tim\_C](#):
>
> n8n update:workflow --all --active=true

The same error happens both on startup, and if I run it manually in the container:

```auto
data # n8n update:workflow --all --active=true
Deactivating all workflows
Done
/data # 

```

---

<div class="post-metadata">

**Author:** ![Tim\_C](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tim_c/32/22639_2.png) [@Tim\_C](https://community.n8n.io/u/Tim_C)\
**Post date:** [June 19, 2023, 11:00pm UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295/3 "2023-06-19T23:00:44Z")

</div>

Additionally, I get this error when activating them through the UI:

```auto
Workflow could not be activated:

*Request failed with status code 401*

```

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [June 20, 2023, 6:17am UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295/4 "2023-06-20T06:17:01Z")

</div>

Hi @Tim_C, I am very sorry you’re having trouble.

I was not able to reproduce the problem based on your description, but is there a chance your credentials file is encrypted or you are using n8n’s user management functionality?

If your credentials are encrypted n8n might not be able to decrypt these (unless both your source instance and your current instance have the same encryption key) and can’t use them to activate your workflows.

If you are using the user management features in n8n, are you trying to activate the workflows in question as the owner? The CLI does not account for user accounts afaik, so I reckon this could play a role here. It would be great if you could provide example files (dummy credentials/workflows without any confidential data) using which this can be verified.

Lastly, when manually running a CLI command in the container make sure to do this under the `node` user as [documented here](https://docs.n8n.io/hosting/cli-commands/#running-cli-commands).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 18, 2023, 6:17am UTC](https://community.n8n.io/t/n8n-cli-workflows-not-activating/27295/5 "2023-09-18T06:17:14Z")

</div>

Closed on September 18, 2023, 6:17am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
