There is a ready n8n workflow that:
- Checks comments in Worksection for the last 3 days on a schedule.
- If there are new comments, generates a client update via OpenAI.
- Sends the update to the PM in Telegram for approval.
- The PM has buttons:
Confirm and send to client, Revise, Copy, Reject.
It is necessary to refine the existing workflow, not to create a new one from scratch. The JSON workflow will be provided.
1. Refine Telegram buttons
"Confirm and send to client"
When pressed:
- the final text for the client is sent to the client;
- without service blocks, buttons, project name, technical information;
- the message goes to
client_chat_id specified in the configuration; - a confirmation appears in the PM chat;
- repeated pressing should not duplicate the sending.
"Revise"
When pressed:
- the bot asks the PM to write a revision response;
- the PM can send the revision as text or voice;
- the voice must be recognized as text;
- OpenAI regenerates the update considering the revision;
- the PM receives a new version with the same buttons;
- revision can be done several times.
"Copy"
When pressed:
- the bot sends the PM a separate message with only the final client text;
- without service information and buttons.
"Reject"
When pressed:
- the draft receives the status of rejected;
- nothing is sent to the client;
- a confirmation is shown in the PM chat;
- old buttons should not allow sending the rejected draft.
2. Add reminder logic if there is no update in the CRM Worksection
If there have been no new substantial comments in Worksection for the last 3 days, the workflow should not just finish.
First reminder in Worksection
The bot must add a comment to the corresponding task in Worksection.
Example text:
Serhiy, hello.
Unfortunately, there has been no new update on this task for the last 3 days.
Please write in this task what has been done in the last 3 days within the project, so I can take this information into account, analyze it, and prepare a regular 3-day update for the client.
Project: "..."
Worksection task: {{task_id}}
Repeated reminder in Telegram
If after the first reminder in Worksection there are still no new comments, on the next run the bot should write to the internal Telegram group of the specialist.
Example text:
"tag dude", hello.
This is the electronic assistant of the project managers of Solarweb.
I remind you that in Worksection every 3 days it is necessary to update the information on the project: what actions have been performed, what is currently in progress, what results, risks, or next steps are there.
This is needed for preparing regular 3-day updates for clients.
Project: "..."
Direction: Targeted advertising
Worksection task: {{worksection_task_url}}
Please go to Worksection and write what has been done in the last days.
The Telegram message should go not to the client and not to the PM, but to a separate internal chat specified in the configuration.
3. Spam protection
It is necessary to maintain the state in staticData so that the bot does not duplicate reminders.
Logic:
- If there is no update and there has not been a reminder during this period, write in Worksection.
- If a reminder has already been in Worksection, but there are still no comments, write in Telegram.
- Telegram reminders no more than once a day per project.
- If the specialist adds a new comment, the reminder state resets.
- Then the workflow works as standard: generates an update and sends it to the PM for approval.
4. What needs to be considered technically
It is necessary to check and refine:
callback_query from Telegram buttons;- saving drafts in
staticData.pmDrafts; - linking
draft_id with a specific project; - sending only client text;
- processing text and voice revisions;
- re-displaying buttons after revision;
- protection against repeated sending;
- working with long Telegram messages;
- adding a comment in Worksection via API;
- Telegram reminders to the specialist;
- logging understandable statuses;
- so that API keys or tokens do not appear in the logs.
5. Configuration
It is necessary to add or foresee fields:
specialist_name: 'Serhiy',
specialist_telegram_username: 'dog serhiy',
specialist_reminder_chat_id: '-100...',
worksection_task_url: 'https://"000".worksection.com/...',
reminder_enabled: true,
worksection_reminder_enabled: true,
telegram_reminder_enabled: true
If any field is missing, the workflow should not crash but should return an understandable status.
6. Testing
It is necessary to really test the workflow and show the result in test or real Telegram chats.
Show:
- The PM receives an update with buttons.
- "Confirm" sends only the client text to the client.
- "Revise" works with text revision.
- "Revise" works with voice revision.
- "Copy" sends only the client text.
- "Reject" does not send text to the client.
- If there are no comments in Worksection, the bot writes a reminder in Worksection.
- If there are still no comments, the bot writes a reminder in Telegram.
- The bot does not spam with identical reminders.
- After a new comment appears, the bot generates an update.
7. What should be the output
The performer must provide:
- Updated JSON workflow.
- Brief description of changes.
- Instructions for env variables or credentials.
- Explanation of which fields to change for other projects.
- Screenshots or videos of testing.
Acceptance criteria
I import the workflow, substitute my credentials/env variables, and get ready logic without manual refinement:
- the update is generated from Worksection;
- the PM approves, revises, copies, or rejects the text;
- only the approved client text goes to the client;
- if there is no update in Worksection, the bot reminds the specialist;
- duplicate sends and spam reminders are excluded.