Tenho um problema geral com n8n self-hosted e workflows importados de JSON

Olá a todos,
Tenho um problema geral com n8n self-hosted e workflows importados de JSON.
Não acontece apenas com Slack. Acontece com várias integrações:

  • Slack
  • Airtable
  • Notion
  • Shopify
  • OpenAI
  • Gemini
  • OpenRouter
  • Google Drive
  • Gmail
  • outras credenciais similares
    Contexto:
  • As credenciais estão criadas no n8n.
  • As credenciais testam conexão corretamente.
  • Estão criadas no mesmo ambiente de n8n.
  • Os tokens/API keys funcionam.
  • Mas quando abro um nó dentro de um workflow importado de JSON, o menu suspenso de credenciais aparece vazio ou como “No credentials yet”.
  • Recarregar o navegador não resolve.
  • Limpar cache também não resolve.
  • O problema ocorre com nós importados, não apenas com um nó específico.
    O estranho:
    Se dentro do próprio nó clico em “Set up credential” e crio uma credencial nova de lá, então o nó começa a reconhecer credenciais e funciona.
    A solução temporária que estamos usando é:
  1. Criar uma credencial nova/falsa a partir do próprio nó.
  2. Então o n8n já permite escolher uma credencial.
  3. Selecionar ou recriar a credencial correta.
  4. Depois deletar a credencial temporária.
    Mas isso não é prático, porque seria necessário fazer isso em muitos nós e muitas integrações.
    Pergunta principal:
    Como se resolve corretamente esse problema?
    Perguntas específicas:
  5. É um problema de ownership/contexto de usuário/projeto no n8n?
  6. As credenciais criadas na tela Credentials não estão disponíveis para workflows importados por algum motivo?
  7. Existe alguma forma de reatribuir ou re-vincular credenciais existentes a workflows importados sem recriá-las nó por nó?
  8. Existe algum comando CLI ou método recomendado para importar workflows e manter ou reatribuir credenciais?
  9. É necessário que o workflow e a credencial pertençam exatamente ao mesmo usuário/projeto?
  10. Pode ser resolvido a partir da UI do n8n, banco de dados, CLI ou API?
  11. O n8n MCP / Claude Code pode atribuir credenciais existentes a nós importados, ou por segurança deve ser feito manualmente?
    Ambiente:
  • n8n self-hosted
  • Workflows importados de JSON
  • Credenciais criadas no n8n
  • As credenciais testam corretamente
  • O problema afeta vários apps, não apenas Slack
  • Criar a credencial a partir do próprio nó funciona
    Preciso saber qual é a forma correta de resolvê-lo globalmente, não nó por nó.
    Obrigado.

Informações sobre sua configuração n8n

  • Versão do n8n:
  • Banco de dados (padrão: SQLite):
  • Configuração n8n EXECUTIONS_PROCESS (padrão: own, main):
  • Executando n8n via (Docker, npm, n8n cloud, app desktop):
  • Sistema operacional:

Welcome @miki007 to our community! I’m Jay and I am a n8n verified creator.

This is expected behavior - when you import a workflow JSON, the credential IDs inside the JSON won’t match the IDs on your instance, so nodes show empty dropdowns. The cleanest fix: after importing, use the “Credential” dropdown in each affected node - since your credentials are already created and tested, they should appear in the list, just not pre-selected. Select the right credential and save. If you’re importing many workflows, n8n CLI has an n8n import:workflow command that can help with bulk operations, though manual re-mapping is still needed for credentials unless you’re migrating between identical instances using n8n export:credentials + n8n import:credentials.

Thanks for the answer. I understand that imported workflow JSON files keep credential IDs/names from the original instance and that these IDs won’t match my instance automatically.

However, my issue is a bit different: the problem is not only that credentials are not pre-selected. In many imported nodes, the credential dropdown is completely empty or shows “No credentials yet”, even though the credentials already exist in the same n8n instance and test successfully.

If I create a new credential from inside that same node using “Set up credential”, then the node starts recognizing credentials. That makes me think it may be related to one of these:

  1. the imported workflow and the existing credentials belong to different users/projects/spaces;

  2. the imported node expects a different credential type than the credential I created from the Credentials screen;

  3. the workflow was imported into the wrong user/project context.

So my follow-up question is:

What is the recommended way to globally fix this?

Should I import workflows with n8n import:workflow --projectId or --userId so they land in the same context as the credentials?

Is there a supported way to reassign existing credentials to imported workflows in bulk, or is manual remapping/recreating nodes required?

I’m trying to avoid creating temporary credentials node by node across many workflows.

Your diagnosis is right - option 1 is almost certainly the cause. The --projectId and --userId flags in n8n import:workflow control which project/user owns the workflow, but they don’t remap credential IDs inside the workflow JSON. There’s no built-in bulk credential reassignment. The cleanest approach for bulk imports is to export your credentials from the source instance with n8n export:credentials --all, import them to the new instance with n8n import:credentials, and then import the workflows - since the credential IDs will match, nodes won’t show empty dropdowns. If you’re starting fresh without the source credentials, the fastest workaround is still the “Set up credential” trick you already found, since it forces the node to register with a valid ID on your instance.