I have a general issue with n8n self-hosted and workflows imported from JSON

Hello everyone,
I have a general problem with n8n self-hosted and workflows imported from JSON.
It’s not just happening with Slack. It’s happening with several integrations:

  • Slack
  • Airtable
  • Notion
  • Shopify
  • OpenAI
  • Gemini
  • OpenRouter
  • Google Drive
  • Gmail
  • other similar credentials
    Context:
  • The credentials are created in n8n.
  • The credentials test the connection correctly.
  • They are created in the same n8n environment.
  • The tokens/API keys work.
  • But when I open a node inside a workflow imported from JSON, the credentials dropdown appears empty or shows “No credentials yet”.
  • Reloading the browser doesn’t fix it.
  • Clearing the cache doesn’t fix it either.
  • The problem occurs with imported nodes, not just with one specific node.
    The weird part:
    If within the node itself I click “Set up credential” and create a new credential from there, then the node starts to recognize credentials and it works.
    The temporary solution we’re using is:
  1. Create a new/dummy credential from within the node.
  2. Then n8n allows you to choose a credential.
  3. Select or recreate the correct credential.
  4. Then delete the temporary credential.
    But this isn’t practical, because we’d have to do it on many nodes and many integrations.
    Main question:
    How do I fix this problem correctly?
    Specific questions:
  5. Is this an ownership/user context/project issue in n8n?
  6. Are credentials created from the Credentials screen not available for imported workflows for some reason?
  7. Is there a way to reassign or re-link existing credentials to imported workflows without recreating them node by node?
  8. Is there a CLI command or recommended method for importing workflows and maintaining or reassigning credentials?
  9. Do the workflow and credential need to belong to exactly the same user/project?
  10. Can this be fixed from n8n UI, database, CLI, or API?
  11. Can n8n MCP / Claude Code assign existing credentials to imported nodes, or for security reasons must it be done manually?
    Environment:
  • n8n self-hosted
  • Workflows imported from JSON
  • Credentials created in n8n
  • Credentials test correctly
  • The problem affects several apps, not just Slack
  • Creating the credential from within the node does work
    I need to know what the correct way to solve this globally is, not node by node.
    Thank you.

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

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.