跳转至

Create and edit credentials#

Credentials are securely stored authentication information used to connect n8n workflows to external services such as APIs, or databases.

Create a credential#

  1. Select the universal create resource icon button in the upper-left corner of the side menu. Select credential.
  2. If your n8n instance supports projects, you'll also need to choose whether to create the credential inside your personal space or a specific project you have access to. If you're using the community version, you'll create the credential inside your personal space.
  3. Select the app or service you wish to connect to.

Or:

  1. Using the universal create resource icon Create button in the upper-right corner from either the Overview page or a specific project. Select Credential.
  2. If you're doing this from the Overview page, you'll create the credential inside your personal space. If you're doing this from inside a project, you'll create the credential inside that specific project.
  3. Select the app or service you wish to connect to.

You can also create new credential in the credential drop down when editing a node on the workflow editor.

Once in the credential modal, enter the details required by your service. Refer to your service's page in the credentials library for guidance.

When you save a credential, n8n tests it to confirm it works.

Credentials naming

n8n names new credentials "node name account" by default. You can rename the credentials by clicking on the name, similarly to renaming nodes. It's good practice to give them names that identify the app or service, type, and purpose of the credential. A naming convention makes it easier to keep track of and identify your credentials.

Expressions in credentials#

You can use expressions to set credentials dynamically as your workflow runs:

  1. In your workflow, find the data path containing the credential. This varies depending on the exact parameter names in your data. Make sure that the data containing the credential is available in the workflow when you get to the node that needs it.
  2. When creating your credential, hover over the field where you want to use an expression.
  3. Toggle Expression on.
  4. Enter your expression.

Example workflow#

Using the example#

要将模板加载到您的 n8n 实例中:

  1. 下载工作流 JSON 文件。
  2. 在您的 n8n 实例中打开一个新工作流。
  3. 复制 JSON 内容,或选择 工作流菜单 Workflow menu icon > 从文件导入...

示例工作流使用便签来指导您:

  • 黄色:注释和信息。
  • 绿色:运行工作流的说明。
  • 橙色:您需要修改某些内容以使工作流正常工作。
  • 蓝色:引起对示例关键功能的注意。
此页面是否
💬 微信

🚀 与作者交流

关注公众号
n8n实战笔记公众号
n8n实战笔记
📚 教程 💡 案例 🔧 技巧
添加微信
添加作者微信
1对1 专业指导
⚡ 快答 🎯 定制 🚀 支持