Lesson 145 min

How to Connect n8n to Trello

Learn how to connect n8n to Trello by creating a Power-Up to generate an API key and token, and use the Trello trigger to automate your project management workflows.

How to Connect n8n to Trello

Connecting n8n to Trello allows you to trigger powerful automations based on events in your Trello boards, such as cards being moved, created, or updated. This tutorial will walk you through the process of creating a Trello Power-Up to get the necessary API credentials and setting up the Trello trigger in your n8n workflow.


Prerequisites

  • An n8n workflow.
  • A Trello account with a board you want to connect.

Step 1: Create a Trello Power-Up and Get API Key

To connect to Trello, you first need to create a "Power-Up," which is Trello's name for integrations, to generate an API key.

  1. Navigate to the Trello Power-Up admin portal.
  2. Click "New" to create a new Power-Up.
  3. Fill in the required information:
    • Power-Up name: Give it a descriptive name like n8n Connector V2.
    • Workspace: Select your Trello workspace.
    • Support contact email: Enter your email.
  4. Click "Create".
  5. On the Power-Up's page, click "Generate a new API key".
  6. Agree to the terms and click "Generate API key".
  7. Copy the generated API Key. You will need this for n8n.
  8. Next, you must add your n8n instance's URL to the "Allowed origins." In the "Origin" field, paste your n8n URL (e.g., https://your-n8n-instance.com) and click "Add". This is a crucial security step.

Step 2: Manually Generate an API Token

With the API Key, you now need to generate a corresponding API Token to grant your Power-Up access to your Trello account.

  1. In the same Trello Power-Up settings page, click the link that says "You can manually generate a Token".
  2. A new page will open, asking you to authorize the application you just created.
  3. Scroll down and click "Allow" to grant the necessary permissions.
  4. After allowing, you will be presented with your API Token. Copy this token.

Step 3: Configure the Trello Node in n8n

Now you can add the Trello node to your workflow and enter the credentials.

  1. In your n8n workflow, add a Trello Trigger node.
  2. In the "Credential" field, select "Create New".
  3. A dialog will pop up with two fields:
    • API Key: Paste the key you generated in Step 1.
    • API Token: Paste the token you generated in Step 2.
  4. Click "Save". You should see a "Connection tested successfully" message.

Step 4: Find and Add the Model ID

The Trello trigger needs to know which Trello object (or "model") to watch for changes. This is specified by a "Model ID." It can be the ID of a board, a list, or a card.

  1. To get the ID of a Trello board, navigate to your board in Trello.
  2. In your browser's address bar, add .json to the end of the board's URL and press Enter.
  3. The first line of the JSON output will contain the board's "id". It will look like this: "id": "60d5e...a9b".
  4. Copy this ID string.
  5. Go back to the Trello Trigger node in n8n and paste the ID into the "Model ID" field.

Step 5: Test the Trello Trigger

Let's test the trigger to make sure everything is working correctly.

  1. Click "Test workflow" in the n8n editor. The node is now listening for events from your Trello board.
  2. Go to your Trello board and make a change, such as moving a card from one list to another.
  3. Return to n8n. The trigger should have captured the event and will display the data associated with it.

You can now see detailed information about the change, including which card was moved, the list it was in before, and the list it's in now. You've successfully connected n8n to Trello and can start building powerful project management automations.