-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Delivery Stage
- Initial proposal
- Agree implementation proposal
- Estimating
- Funding Confirmed
- Delivered
1. What is the need / problem?
At the end of every order cycle, Hub manager wants an email with a list of producer who had sales in a given order cycle (preferably in form of CSV).
2. Which type of users does this problem affect (and how many, if known)?
Hub Managers
3. What tools does this involve?
Email, CSV
4. Links to connected discussions
https://openfoodnetwork.slack.com/archives/C04U02X3806/p1679964247999209
5. Implementation Proposal
To use a n8n workflow which automatically triggers when an order cycle closes for the hub (using polling with Postgres and function nodes). Then using a SQL query (via the Postgres node in n8n), we will get the list of producers sales and info for that order cycle. After which, the data will be converted into CSV file and will be emailed to the hub manager.
Fields in CSV:
- Order Cycle Name and Id
- Supplier Enterprise Name
- Supplier Enterprise Id
- Supplier Enterprise "Notifications" email address
- Number of orders that include the supplier for the hub's order cycle
- Sum of Quantity*price for items sold in that order cycle
Enterprise Id and OC id are very easy to add in the workflow. So, no extra time is needed for that.
Whats Polling (in context of this issue): Basically, n8n will keep on checking at fixed intervals (every hour - can be reduced if needed), if a new order cycle has closed for the specified enterprise. It's similar to Zapier trigger.
Notes:
- The workflow will be made/developed in USA's n8n account and will be documented in the API handbook.
- Polling interval will be 1 hr initially (i.e. there can be a time gap of up to 1 hr between order cycle closing and the email being sent) - This can be reduced if needed. Polling can be replaced with OFN Order cycle close webhook once it's ready.
- This workflow could be adapted for other hubs by replacing the enterprise id used in SQL query and the email id of the hub manager.
- Email subject and body can be anything (text) (USA can propose what they want email subject and contents to be)
- Need to connect a Gmail account in USA's n8n account to send emails. To do this, I would need access to the email account which would be sending the email.
6. Estimates and funding partners
10-12 hrs