AI Agents

Build an intelligent agent that interacts via Twitter using OpenAI

15 nodes 298 148 Automatic trigger
Download

Workflow Description

An automation that receives commands through direct messaging, processes requests using OpenAI while maintaining conversation history, then posts responses to Twitter/X or executes custom actions based on conditional logic.

How it works

  1. 1.Receive commands and messages via chat trigger
  2. 2.Process text with OpenAI while preserving historical context
  3. 3.Apply conditional rules to determine the appropriate action
  4. 4.Execute custom tools and code based on request type
  5. 5.Publish results to Twitter or store data

Use cases

  • Smart assistant that replies to follower queries directly on Twitter
  • Autonomous agent that performs automated tasks based on natural language commands
  • Advanced conversation management system that retains context across long dialogues

Requirements

  • Active OpenAI account with API key
  • Twitter/X account with publishing and reading permissions
  • Memory storage to maintain context between conversations

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Chat Trigger OpenAI Memory Twitter/X Tool Code

Details

Trigger Automatic trigger
Nodes 15
Apps 6
Views 298
Downloads 148

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (15)

/

Sticky Note

Sticky Note

#1

Sticky Note1

Sticky Note

#2

When chat message received

Chat Trigger

#3

OpenAI

OpenAI

#4

Simple Memory

Memory Buffer Window

#5

When Executed by Another Workflow

Execute Workflow Trigger

#6

Tool to call the workflow below

Tool Workflow

#7

Tool: Get current date and time

Tool Code

#8

List countries?

If

#9

Mapping data

Code

#10

Concatenate country names

Summarize

#11

Return country list

Set

#12

Mapping data1

Code

#13

Get the matching country's details

Merge

#14

Return specific capital

Set

#15