Automation Flow with Dynamic PDF Quotation and Telegram Integration

Hello,

I’m currently building an automation flow for a potential client. The process begins with a form submission from their website, which is stored in Google Sheets. Each new entry triggers an automation that generates a PDF quotation based on a custom prompt. This prompt dynamically adjusts pricing according to variables such as the number of people and other factors.

Once the PDF is created, it is sent to the client via Telegram, along with a callback query that allows them to either approve the quotation or request modifications.

Here’s where I’m facing a challenge: I need to pass variables between different flows. However, since most automation platforms allow only two triggers per flow (or have limitations on trigger chaining), I’m unsure how to maintain variable continuity between steps. My goal is to create a loop where:

  1. The client can request edits to the PDF.
  2. The corrected version is automatically regenerated and sent back via Telegram.
  3. This continues until the client approves it.
  4. Once approved, an email is sent automatically—ideally triggered via Instagram DM confirmation.

If you have any suggestions or best practices for managing state or passing variables across automation steps (e.g., between flows or bots), I’d appreciate your input.

Thank you!

1- Maintaining State Between Automatic Steps
n8n allows you to chain triggers using webhooks, but is limited to two triggers per flow. A good practice is to store the intermediate context (Telegram form and response) in a database (Google Sheets, Airtable) or using temporary variables (such as Set or Function). When Telegram responds with a callback query, you receive user data that you need to correlate with the original input and continue the flow in another webhook or sub-workflow.

2- Dynamic PDF Generation
You can use nodes like PDFMonkey or integrations with external services via HTTP Request and construct data to generate documents based on variables (quantity, price, name, etc.). The dynamic prompt can be built with form IP variables to feed the PDFMonkey template.

3- Telegram Integration
n8n has native integration with the Telegram Bot API, allowing you to send messages with PDF attachments. It also supports callback queries, which you can capture with the Telegram Trigger node and then direct the flow to another branch based on the user’s response (“approve” / “modify”).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.