AI-Powered Unsplash to Pinterest Workflow with RAG

Overview

This workflow provides an intelligent pipeline for processing and storing data related to Unsplash images for Pinterest. It uses a Retrieval-Augmented Generation (RAG) architecture to automatically ingest content, generate embeddings, store them in a vector database (Supabase), and then process queries using an AI agent. The workflow is triggered via a webhook, making it suitable for integration with external applications or manual testing.

Node-by-Node Breakdown

  1. Sticky Note — A visual note for documentation purposes. It displays the title "Automated workflow: Unsplash to Pinterest" on the canvas. No authentication required.

  2. Webhook Trigger — Listens for incoming HTTP POST requests at the path /unsplash-to-pinterest. This is the entry point for the workflow. When triggered, it passes the incoming data to the next nodes. (No auth)

  3. Text Splitter — Splits incoming text into chunks of 400 characters with a 40-character overlap. This prepares the data for embedding by breaking it into manageable pieces. (No auth)

  4. Embeddings (Cohere) — Generates vector embeddings for each text chunk using the embed-english-v3.0 model from Cohere. These embeddings represent the semantic meaning of the text. (API Key auth — requires a Cohere API key)

  5. Supabase Insert — Inserts the generated embeddings into a Supabase vector store named unsplash_to_pinterest. This stores the data for later retrieval. (API Key auth — requires Supabase credentials)

  6. Supabase Query — Queries the same Supabase vector store (unsplash_to_pinterest) to retrieve relevant vectors based on similarity search. This is used by the RAG agent to find context. (API Key auth — requires Supabase credentials)

  7. Vector Tool — Wraps the Supabase vector store as a tool that the AI agent can use to retrieve context. It's labeled "Vector context" for clarity. (No auth — uses the Supabase connection from the previous nodes)

  8. Window Memory — Provides a buffer window memory for the AI agent, allowing it to maintain conversation context across multiple interactions. (No auth)

  9. Chat Model (OpenAI) — The language model that powers the AI agent. It uses OpenAI's chat model to process queries and generate responses. (API Key auth — requires an OpenAI API key)

  10. RAG Agent — The core AI agent that combines the chat model, vector tool, and memory. It processes incoming data with the prompt: "Process the following data for task 'Unsplash to Pinterest':" and includes a system message: "You are an assistant for Unsplash to Pinterest". (No auth — uses connections to other nodes)

  11. Append Sheet (Google Sheets) — Appends the AI agent's output to a Google Sheet. It writes to a sheet named "Log" in a document identified by SHEET_ID. The column "Status" is populated with the agent's response text. (OAuth2 — requires Google Sheets API credentials)

  12. Slack Alert — Sends an error notification to the #alerts Slack channel if the RAG Agent encounters an error. The message includes the error details. (OAuth2 — requires Slack API credentials)

Setup Instructions

To use this workflow, you'll need accounts and API keys for the following services:

  • Cohere: Sign up at cohere.com and generate an API key for the embeddings model.
  • Supabase: Create a project at supabase.com and set up a vector store with the name unsplash_to_pinterest. You'll need your Supabase URL and service role key.
  • OpenAI: Get an API key from platform.openai.com for the chat model.
  • Google Sheets: Create a Google Sheet with a sheet named "Log" and note the Sheet ID from the URL. Set up OAuth2 credentials in the Google Cloud Console.
  • Slack: Create a Slack app, add it to your workspace, and obtain OAuth tokens. Create a channel named #alerts for error notifications.

Configure each node's credentials in n8n by clicking on the node and selecting "Add Credential" or selecting existing ones.

Use Cases and Variations

This workflow is ideal for:

  • Content Curation: Automatically process and store descriptions of Unsplash images for later retrieval and Pinterest posting.
  • Knowledge Base: Build a searchable database of image metadata with semantic search capabilities.
  • Automated Content Moderation: Use the AI agent to analyze image descriptions and flag inappropriate content before posting.

Possible Adaptations:

  • Replace the webhook trigger with a Schedule Trigger to run the workflow at regular intervals.
  • Swap the Cohere embeddings with OpenAI embeddings or Hugging Face embeddings.
  • Instead of Google Sheets, output to Airtable, Notion, or PostgreSQL.
  • Add an HTTP Request node after the RAG Agent to post processed data directly to Pinterest's API.
  • Use a different vector store like Pinecone or Qdrant instead of Supabase.
12 nodeswebhook triggerAI
Sticky NoteWebhookText Splitter Character Text SplitterEmbeddings CohereVector Store SupabaseTool Vector StoreMemory Buffer WindowLm Chat Open AI

Workflow JSON

{
  "name": "Unsplash to Pinterest",
  "nodes": [
    {
      "parameters": {
        "content": "Automated workflow: Unsplash to Pinterest",
        "height": 530,
        "width": 1100,
        "color": 5
      },
      "id": "8da48de7-ef4d-4d78-8c0e-3c6b57ef3b9a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -480,
        -240
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "unsplash-to-pinterest"
      },
      "id": "672c0eab-878f-484d-a072-9482935437c4",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -300,
        0
      ]
    },
    {
      "parameters": {
        "chunkSize": 400,
        "chunkOverlap": 40
      },
      "id": "87553792-b816-44e2-ac2f-64d0f9a5adf5",
      "name": "Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        -130,
        0
      ]
    },
    {
      "parameters": {
        "model": "embed-english-v3.0",
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

Telegram AI Bot with DALL-E Image Generation using LangChain

Overview This workflow creates an intelligent Telegram bot that leverages OpenAI's GPT-4o and DALL-E 3 models through n8n's LangChain integration. The bot can hold context-aware conversations (remembering the last 10 messages per user) and generate images on demand—all via simple Telegram messages. It's ideal for building personal assistants, creative bots, or customer support agents that need visual output. Node-by-Node Walkthrough Here's every node in the workflow, along with its authentication method and key configuration: Listen for incoming events (Telegram Trigger — No auth; bot token set in node credential) – Listens for all types of Telegram updates (messages, commands, etc.). No authentication parameters are required directly on the node; the Telegram bot token is configured via the node's credential settings. AI Agent (LangChain Agent — No auth; relies on connected sub‑nodes) – The core of the workflow. It receives the incoming message text and uses the attached language model (OpenAI Chat Model), memory (Window Buffer Memory), and tools (Send back an image / Generate image in Dalle) to decide what action to take. OpenAI Chat Model (LangChain Chat Model — API Key auth via credential) – Uses with a temperature of 0.7 and frequency penalty of 0.2. This model powers the agent's text responses. Window Buffer Memory (LangChain Memory — No auth) – Stores the last 10 messages per user (keyed by Telegram chat ID) to maintain conversational context. Generate image in Dalle (LangChain HTTP Request Tool — API Key auth via credential) – A custom tool that sends a POST request to with model and a prompt (provided by the AI agent). The tool description tells the agent to call it when the user asks to draw something. Send back an image (Telegram Tool — API Key auth via Telegram credential) – Sends a file (image URL from the DALL-E response) to the user's chat ID using the operation. This is exposed as a tool the AI agent can call. Send final reply (Telegram Node — API Key auth via Telegram credential) – Sends the AI agent's text output (from ) back to the user. Note: On error, the workflow continues to the error output (useful for debugging). Detailed Flow The Telegram Trigger catches any incoming message from your bot. The message text is passed to the AI Agent. The agent uses the OpenAI Chat Model to understand the request and generate a response. It also checks the Window Buffer Memory for recent conversation history. If the user asks for an image, the agent calls the Generate image in Dalle tool, which returns an image URL. The agent then uses the Send back an image tool to send that image to the user. For all other requests, the agent produces a text response, which is sent via the Send final reply node. Setup Instructions Telegram Bot – Create a bot via @BotFather and get the API token. In n8n, create a Telegram credential and paste the token. OpenAI Account – Obtain an API key from OpenAI's platform. Create an credential in n8n and paste the key. This credential is used by both the Chat Model and the DALL-E tool. Workflow Activation – After configuring the credentials, activate the workflow. n8n will automatically set up the webhook for the Telegram trigger (no manual URL needed—n8n handles it internally). Test – Send a message to your bot on Telegram. Try asking a question or say “Draw a cat wearing a hat” to trigger image generation. Use Cases & Variations Personal Assistant – Extend with additional tools (web search, calendar lookup, weather API) to make a full‑fledged chatbot. Customer Support – Replace the OpenAI model with a fine‑tuned model or add a fallback to a human agent using n8n's error handling. Image Editor – Modify the DALL-E tool to accept style parameters or multiple images. Multi‑Language – Add a translation node before the AI agent to support multiple languages. Logging – Insert a database node (e.g., Google Sheets, PostgreSQL) to store conversation logs for analysis.

8 nodes

Convert Text to Speech Using OpenAI TTS API

Overview This workflow converts any text into natural-sounding speech using OpenAI's Text-to-Speech (TTS) API. It is ideal for generating audio content for accessibility, voiceovers, podcasts, or language learning. The workflow is triggered manually for testing, but can easily be adapted to run on a schedule, via webhook, or as part of a larger automation. Node-by-Node Breakdown When clicking "Test workflow" (Manual Trigger) — No auth. This node starts the workflow when you click the "Execute Workflow" button in the n8n editor. It has no parameters and is used for testing. Set input text and TTS voice (Set) — No auth. This node defines the text to be converted and the voice to use. It outputs a JSON object with two fields: - : The text you want to turn into speech (e.g., "The quick brown fox jumped over the lazy dog.") - : The voice model to use (e.g., "alloy"). Other options include "echo", "fable", "onyx", "nova", and "shimmer". Send HTTP Request to OpenAI's TTS Endpoint (HTTP Request) — API Key auth (via OpenAI credential). This node sends a POST request to with the following body parameters: - : (the TTS model) - : The text from the previous node (using expression ) - : The voice from the previous node (using expression ) The request is authenticated using an OpenAI API key stored in an n8n credential. The response is a binary MP3 audio file. Setup Instructions OpenAI Account: You need an OpenAI account with API access. Obtain an API key from the OpenAI dashboard. n8n Credential: In n8n, create a new credential of type "OpenAI". Paste your API key into the credential. Configure the HTTP Request Node: The node is already set to use the OpenAI credential. Ensure the credential is selected in the node's settings. Customize Text and Voice: Modify the and values in the Set node as needed. The maximum input length is 4,000 tokens. Use Cases and Variations Automated Podcast Generation: Replace the manual trigger with a Schedule Trigger to generate daily audio summaries from a news feed. Accessibility: Use a Webhook Trigger to accept text from a form or chat, then return the audio file to the user. Language Learning: Combine with a Translate node to convert foreign language text into speech. Content Creation: Integrate with a Google Drive node to save the generated MP3 files automatically. Voice Customization: Experiment with different voice options (alloy, echo, fable, etc.) to match the tone of your content.

8 nodes

Telegram RAG Chatbot with File Upload and Groq LLM

This workflow creates a Telegram chatbot that uses Retrieval-Augmented Generation (RAG) to answer questions based on documents you upload. Users can send PDF or CSV files to a Telegram chat, and the workflow processes them into a vector database. When a user then sends a text message, the AI agent retrieves relevant chunks from the stored documents and generates an answer using the Groq Llama 3.1 model. It's like having a personal assistant that learns from your files and responds via Telegram. Node-by-Node Walkthrough Telegram Message Trigger (Telegram Trigger, no authentication required on the node itself — authentication is handled via the Telegram Bot API credentials configured in the n8n credentials store). This trigger listens for all types of updates (messages, commands, etc.) from a Telegram bot. When a new update arrives, it starts the workflow. Get a chat1 (Telegram node, Telegram Bot API token auth). It extracts the from the incoming message and passes it to the next node, ensuring the AI agent knows which chat to reply to. AI Agent1 (LangChain Agent, no auth). This is the core of the workflow. It uses a system message that instructs the AI to answer only from the knowledge base. The agent has access to the Groq Chat Model as its language model and the Retrieve documents tool to fetch relevant document chunks. It also uses Simple Memory to keep conversation context within a session (keyed by the Telegram chat ID). Groq Chat Model (Groq LLM, Groq API key auth). Uses the model. This provides fast, coherent answers. Simple Memory (Memory Buffer Window, no auth). Stores the last few turns of conversation to give the agent context. The session key is set to the Telegram chat ID from the trigger. Retrieve documents (Vector Store as Tool, no auth). This tool allows the agent to query the in-memory vector store. It returns the top 10 most similar document chunks. Embeddings HuggingFace Inference1 (Hugging Face Inference, Hugging Face API key auth). Generates embeddings for the user's query so the vector store can find relevant documents. Upload your file here (Form Trigger, no auth). This form trigger provides a web form where users can upload or files. The uploaded file(s) are passed to the Default Data Loader1. Default Data Loader1 (Document Default Data Loader, no auth). Converts the uploaded binary file into a LangChain document object. Recursive Character Text Splitter (Text Splitter, no auth). Splits the document into chunks of up to 3,000 characters with 200 character overlap. This ensures the vector store indexes manageable pieces. Simple Vector Store (In-Memory Vector Store, no auth). Stores the document chunks along with their embeddings. The embedding model used is Embeddings HuggingFace Inference. Embeddings HuggingFace Inference (Hugging Face Inference, Hugging Face API key auth). Generates embeddings for each document chunk before storing them. Reply in Telegram1 (Telegram node, Telegram Bot API token auth). Sends the AI agent's output back to the same Telegram chat. Setup Instructions Telegram Bot: Create a bot via @BotFather and get its API token. In n8n, add a Telegram credential using this token. Groq: Sign up at GroqCloud to get an API key. Add a Groq credential in n8n. Hugging Face: Create a free account at Hugging Face and generate an Inference API token. Add a Hugging Face Inference credential in n8n. n8n Form Trigger: This node is built-in. Ensure your n8n instance is publicly accessible (or use a tunnel like ngrok) so the form can be accessed by users. Deploy: Activate the workflow. Share the Telegram bot username with users. They can upload files by visiting the form URL (the one generated by the Upload your file here node) and then send text messages to the bot. Use Cases and Variations Personal knowledge base: Upload company policies, technical documentation, or study materials and ask questions about them via Telegram. Customer support bot: Replace the file upload with an HTTP node that fetches FAQs from a database, and use the same RAG architecture to answer customer queries. Multi-user support: The session memory is already scoped by Telegram chat ID, so multiple users can use the bot simultaneously without interfering. Switch LLM: Replace Groq with OpenAI, Anthropic, or any other supported LLM provider by changing the model node. Persistent vector store: Swap the in-memory vector store for Pinecone, Weaviate, or Qdrant to retain documents across restarts.

15 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.