This n8n template demonstrates how to automatically process feedback on tasks and procedures using an AI agent. Employees provide feedback after completing a task, which is then analyzed by the AI to suggest improvements to the underlying procedures. Improvements can be to update how to execute a single tasks or to split or merge tasks within a procedure. The management reviews decides whether to implement those improvements.
This makes it easy to close the loop between execution, feedback, and continuous process improvement. Use cases are many:
- Marketing (improve the process of approving advertising content)
- Finance (optimize the process of expense reimbursement)
- Operations (refine the process of equipment maintenance)
Good to know
- The automation is based on the Baserow template for handling Standard Operating Procedures. However, it can also be implemented in other databases.
- Baserow authentication is done through a database token. Check the documentation on how to create such a token.
- Tasks are inserted using the HTTP request node instead of a dedicated Baserow node. This is to support batch import instead of importing records one by one.
Requirements
- Baserow account (cloud or self-hosted)
- The Baserow template for handling Standard Operating Procedures or a similar database with the following tables and fields:
Procedures
table with general procedure information like to name or description .
Procedures steps
table with all the steps associated with a procedure.
Tasks
table that contains the actual tasks based on the procedure steps.
- must have a field to capture
Feedback
- must have a boolean field to indicate if the feedback has been processed or not. This to avoid that the same feedback keeps getting used.
Improvement suggestions
table to store the suggestions that were made by the AI agent.
How it works
-
Set table and field ids
- Stores the ids of the involved Baserow database and tables, together with the information to make requests to the Baserow API
-
Feedback processing agent
The prompt contains a small instruction to check the feedback and suggest improvements to the procedures. The system message is much more extensive to provide as much details and guidance to the agent as possible. It contains the following sections:
- Role: giving the agent a clear professional perspective
- Goals: allowing the agent to focus on clarity, efficiency and actionable improvements.
- Instructions: guiding the agent to a step-by-step flow
- Output: showing the agent the expected format and details
- Notes: setting guardrails for the agent to make justified and practical suggestions.
The agent uses the following nodes:
- OpenAI Chat Model (Model): the template uses by default the gpt-4.1 model from OpenAI. But you can replace this with any LLM.
- current_procedures (Tool): provides information about all available procedures to the agent
- current_procedure steps (Tool): provides information about every step in the procedures to the agent
- tasks_feedback (Tool): provides the feedback of the employees to the agent.
- Required output schema (Output parser): forces the agent to use a JSON schema that matches the
Improvement suggestions
table structure for the output. This allows to easily add them to the database in the next step.
-
Create improvement suggestions
- Calls the API endpoint
/api/database/rows/table/{table_id}/batch/
to insert multiple records at once in the Improvement suggestions
table. The inserted records is the output generated by the AI agent. Check the Baserow API documentation for further details.
-
Get non-processed feedback
- Gets all records from the
Tasks
table that contain feedback but that are not marked as processed yet.
-
Set feedback to processed
- Updates the boolean field for each task to true to indicate that the feedback has been processed
-
Aggregate records for input
- Aggregates the data from the previous nodes as an array in a property named
items
. This matches perfect with the Baserow API to insert new records in batch.
-
Update tasks to processed feedback
- Calls the API endpoint
/api/database/rows/table/{table_id}/batch/
to update multiple records at once in the Tasks
table. The updated records will have their processed field set to true. Check the Baserow API documentation for further details.
How to use
- The Manual Trigger node is provided as an example, but you can replace it with other triggers such as a webhook
- The included Baserow SOP template works perfectly as a base schema to try out this workflow.
- Set the corresponding ids in the
Configure settings and ids
node.
- Check if the field names for the filters in the
tasks_feedback
tool node matches with the ones in your Tasks
table.
- Check if the field names for the filters in the
Get non-processed feedback
node matches with the ones in your Tasks
table.
- Check if the property name in the
Set feedback to processed
node matches with the ones in your Tasks
table.
Customising this workflow
- You can add a new workflow that updates the procedures based on the acceptance or rejection by the management
- There is a lot of customization possible in the system prompt. For example: change the goal to prioritize security, cost savings or customer experience