Hi everyone. I’m a beginner on the n8n platform, but I guess there are features that allow me to implement my user scenario.
Below I describe the workflow I want to implement and questions with troubles. Thank you, for your help!
In short: I want create a content manager, based on telegram bot and Google sheets.
Step by step:
User sends content via telegram bot (text, image, file, audio)
Bot saves content and data about user to new row in Google sheets
Bot shows keyboard with choices (Add comment and select folder)
User presses “add comment” button
Bot sends a “Enter comment” message
User enters a comment
Bot adds a comment to column “Comment” to existed row in Google sheets, where it has recorded the user’s content and data
The user presses the “select folder” button
Bot shows the other keyboard with the folders list (from a predefined variable)
User presses a button with the required folder name
Bot adds folder name to to column “Folder” to existed row in the Google sheets line, where he has already written the content, user data and comment.
Questions:
Points 4-6 - I don’t understand how I can distinguish through a telegram trigger that the user replied to the bot’s “Enter Comment” question rather than sending in new content. Is this even realistic to do? Also, I don’t understand how the keyboard callback function in the telegram trigger works, I thought it was needed for this, but it doesn’t work when testing…
I tried point 7, but it doesn’t work to add a value to an existing google sheets row
Telegram Trigger works only one time, It is designed or made in such way to receive an event once and execute it.
n8n is a workflow model. Means, once the data is received via Trigger or WebHook it process the data or perform stuffs based on the received data until the workflow is fully complete.
We can’t make the workflow to wait for the next data to receive. (You can’t have trigger node between two nodes. Because triggers are meant only for starting the workflow, But there is a workaround for this)
You can either have multiple workflows like above screenshot and check the trigger message you receive from Telegram with the help of IF Node.
For Example:
In workflow 1 - I have a telegram trigger, after that there is one IF Node which checks whether the message contains “/start”. If Yes, It’ll reply “Please send the right command to start”.
In Workflow 2 - I have same setup but IF Node should check whether received message has “New Comment” as text. If Yes, Then It’ll start the Workflow, and perform next actions.
This way, You can divide the workflows for easier understanding.
Summary:
You need multiple workflow, Because trigger works only one time Or You have to do it with Multiple IF Conditions the send it to the TRUE or FALSE Branch
@Nikita_Bessonov I built this Telegram interactive quiz bot a while back.
It covers most of the functionality that you are trying to achieve.
I used Airtable instead of Google Sheets.
Hope it helps. Let me know if you have any queries.
Hi @harshil1712@mcnaveen@shrey-42
Thank you so much for your help, I guess I will try to recombine the workflow shared by @shrey-42 and I hope that will useful.
And thanks to n8n team, you made a really wonderful community. I’m excited!