Skip to main content

Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI

Workflow preview

Workflow preview
100%
Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI preview
Open on n8n.io

1. Workflow Overview

Automatically extract stock transactions from Indonesian broker trade confirmation documents sent via Telegram using AI vision. How it works: Send a PDF or image of your broker trade confirmation t...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.switch, n8n-nodes-base.telegramtrigger, n8n-nodes-base.code, n8n-nodes-base.telegram, n8n-nodes-base.httprequest, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Andri Darnius.

Original n8n.io source

1.1 Workflow description

Title
Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI
Workflow name
Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI

Automatically extract stock transactions from Indonesian broker trade confirmation documents sent via Telegram using AI vision.

How it works:

Send a PDF or image of your broker trade confirmation to the bot. The workflow downloads the file, encodes it, and sends it to OpenRouter (Gemini) for AI extraction. All detected transactions are displayed in a single confirmation message with ✅ Save All / ❌ Cancel buttons. The extracted data is stored temporarily using workflow static data, ready to be forwarded to any destination on confirm.

Features:

Supports PDF and image (JPG, PNG, screenshot) Handles multi-transaction documents — all shown in one batch confirmation Indonesian market aware — quantity in lots (1 lot = 100 shares) Extracts: ticker, company name, type, quantity, price, fee, total, date, broker, confidence score Low-confidence extractions handled gracefully Modular — connect the confirm output to any node (HTTP Request, Google Sheets, Airtable, Notion, database, etc.) Required credentials:

Telegram account — your bot token from BotFather OpenRouter API — Header Auth credential (Authorization: Bearer sk-or-v1-...) Setup:

Import workflow Add credentials Expose n8n via HTTPS (Cloudflare Tunnel, ngrok, or public server) Activate workflow — webhook registers automatically Send a broker PDF to your bot Default model: google/gemini-2.5-flash-lite via OpenRouter (free tier available)

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note - Message Intake

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note - File Processing

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note - AI Extraction

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note - Confirmation

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Route Type1

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 7 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.1

Block 8 - Parse Message

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Extract File Info

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Download File

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Prepare File

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Build Request

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - OpenRouter Extract

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Parse Invoice

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Invoice Error?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 16 - Format Confirmation

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Send Confirmation

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 18 - Reply Invoice Error

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

3. Summary Table

Workflow Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI
Complexity advanced
Nodes 18
Categories Invoice Processing, AI Summarization
Author Andri Darnius
Published 22 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14252/14252.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract Indonesian stock (IDX) trades from Telegram invoices with Gemini AI do?

Automatically extract stock transactions from Indonesian broker trade confirmation documents sent via Telegram using AI vision. How it works: Send a PDF or image of your broker trade confirmation t...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.