Motia Icon

Trello Card Automation

Build an automated card progression system for Trello boards with AI-powered summaries

Live Example

Try out the code directly in your browser:

Let's build a Trello automation system that:

  1. Automatically progresses cards across board lists
  2. Validates card completeness
  3. Generates AI-powered summaries for code review
  4. Integrates with Slack for notifications
  5. Monitors due dates and sends overdue alerts

Board Structure

The Trello board is organized into four main lists:

  • New Cards: Entry point for all new cards
  • In Progress: Active development stage
  • Needs Review: Code review stage with AI summaries
  • Completed: Successfully reviewed and approved cards

The Steps

trello-webhook.step.ts
trello-webhook-validation.step.ts
validate-card-requirements.step.ts
start-assigned-card.step.ts
mark-card-for-review.step.ts
complete-approved-card.step.ts
check-overdue-cards.step.ts
slack-notifier.step.ts

Visual Overview

Here's how the automation flow works:

Flow: Trello Automation Steps
  1. Card Validation → Checks for required information
  2. Progress Tracking → Moves cards between lists
  3. Review Process → Generates AI summaries and notifies reviewers
  4. Completion Handling → Processes approved cards

Try It Out

Prerequisites

Make sure you have:

  • Trello account with API access
  • Node.js installed
  • Slack workspace (for notifications)
  • OpenAI API key (for AI summaries)

Clone the Repository

git clone git@github.com:MotiaDev/motia-examples.git
cd examples/trello-flow

Install Dependencies

pnpm install

Configure Environment Variables

Create a .env file by copying the example:

cp .env.example .env

Update your .env with the following credentials:

TRELLO_API_KEY=your_trello_api_key
TRELLO_TOKEN=your_trello_token

OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=your_openai_model

SLACK_WEBHOOK_URL=your_slack_webhook_url

TRELLO_NEW_TASKS_LIST_ID=your_new_tasks_list_id
TRELLO_IN_PROGRESS_LIST_ID=your_in_progress_list_id
TRELLO_NEEDS_REVIEW_LIST_ID=your_needs_review_list_id
TRELLO_COMPLETED_LIST_ID=your_completed_list_id

Set Up Trello Board

  1. Create a new Trello board with these lists:

    • New Tasks
    • In Progress
    • Needs Review
    • Completed
  2. Add a custom field:

    • Status (dropdown: Todo, In Progress, Done)

Run the Application

pnpm dev

Test the Flow

  1. Create a new card in the "New Tasks" list
  2. Assign a member to see it move to "In Progress"
  3. Add an "approved" comment to see it move to "Completed"
  4. Check Slack for notifications

For more detailed setup instructions and configuration options, check out the full documentation.

Need help? See our Community Resources for questions, examples, and discussions.

On this page