Automate Elasticsearch searches using an n8n workflow form trigger. Generate customizable CSV or Text reports for suspicious transactions and save them instantly using this powerful n8n template.
Download this n8n workflow template and start using it instantly.
Leveraging the power of n8n, this dynamic search pipeline transforms a simple web form input into a sophisticated query against an Elasticsearch index. The core challenge solved by this n8n workflow is bridging the gap between non-technical users and complex database interactions. By starting with an n8n trigger (the Form Trigger), users can define criteria like minimum transaction amount, time range, and customer ID. A key part of this automation is the use of an n8n node dedicated to generating the complex JSON structure required for Elasticsearch's API. Finally, the n8n template automatically formats the results into either a text report or a CSV file, saving it locally for immediate use, providing significant efficiency gains for financial monitoring or DevOps auditing.
The process begins when a user submits data through the custom web interface provided by the n8n trigger, the Form Trigger node.
Search Form n8n node collects criteria such as time range (e.g., 'Last 3 Days') and minimum transaction amount.Build Search Query Code n8n node converts the human-readable inputs into a valid Elasticsearch boolean query JSON structure (using now-1h, now-24h, etc., for timestamp filtering). This is a critical step utilizing core logic flow control within the n8n workflow.Search Elasticsearch HTTP Request n8n node executes this complex query against the specified ES index (e.g., bank_transactions) using basic HTTP authentication.Format Report Code n8n node processes the returned JSON hits. Based on the user's selection, it generates a structured Text Report or a precise CSV file, packaging the output as binary data ready for saving.Read/Write Files from Disk n8n node saves the binary report content to the server's /tmp/ directory, completing the automated report generation cycle defined by this n8n template.Search Elasticsearch HTTP Request n8n node. You must set up a Generic Credential Type (HTTP Basic Auth) defining the username and password necessary to access your Elasticsearch cluster.Search Elasticsearch n8n node. It is currently set to https://localhost:9220/banktransactions/search. Adjust the host, port, and index name (bank_transactions) to match your actual Elasticsearch environment.Read/Write Files from Disk n8n node has permission to write to the designated /tmp/ location. Search Form (n8n Trigger): Serves as the user interface and entry point. It collects necessary search parameters, including minimum amount, a required time range dropdown, an optional Customer ID field, and the desired Report Format (Text or CSV).
Build Search Query (Code n8n node): Essential for core logic flow control. It uses JavaScript to parse form inputs, dynamically constructs the Elasticsearch JSON query (using bool/must clauses for timestamp range, amount range, and optional customer ID term filter), and converts time ranges (e.g., 'Last 24 Hours') into ES-compatible time notations.
Search Elasticsearch (HTTP Request n8n node): Executes the data search. It sends a POST request containing the dynamic JSON query generated by the previous n8n node to the /banktransactions/search endpoint. It is configured to use HTTP Basic Authentication.
Format Report (Code n8n node): Responsible for data manipulation and output preparation. It iterates over the Elasticsearch results, formats the data into either a human-readable text file or a machine-readable CSV file, and transforms the content into binary data ready for saving. This n8n node also handles filename generation.
Format Report n8n node and saves the resulting report file (e.g., report_YYYY-MM-DD.csv) to a predefined location on the server's file system.Deploy a scalable, context-aware AI chatbot using this advanced n8n workflow. Integrates OpenAI and uses MongoDB for real-time knowledge retrieval. Start automating today.

Use this advanced n8n workflow to manage your media library, creating dummy files for instant Plex access and triggering on-demand downloads via Radarr, Sonarr, Tautulli, and Overseerr integration. Get these n8n templates today!

Use this advanced n8n workflow to dynamically select and rank Model Context Protocol (MCP) servers using an OpenAI LLM for initial decision making and Contextual AI for highly relevant reranking. Explore n8n templates for tool calling.

Build a dynamic, site-aware AI assistant using this advanced n8n workflow. Integrates DeepSeek via OpenRouter, Pinecone for RAG, and Postgres for history, enabling multi-site support.








































