openfoodfoundation / integrations Goto Github PK
View Code? Open in Web Editor NEWA place to store scripts and other little integration scripts
A place to store scripts and other little integration scripts
Since n8n is self hosted by OFN. There is a limited amount of storage/memory available for it (this can be increased/decreased by paying more/less for the hosting space). All the n8n instances/accounts share this storage/memory. Therefore, if multiple instances are running memory intensive workflows at the same time then some running workflows may crash. We would get an error like: n8n has run out of memory or execution can't be found etc. But those same workflows may work fine if then are run at different time.
I had this issue multiple times when I run a memory intensive workflows like working with bulk products API with an output of over 1000+ variants using function nodes or other modules like airtable.
As more and more people/instances start using n8n, we might face the memory issue often which will in turn make n8n automations less reliable.
There are ways/good practices to reduce memory usage of a workflow for ex. using sub-workflows for memory intensive tasks in conjunction with split in batches, avoid using code/function module if possible etc. Obviously we can have a list of methods/tips to reduce memory of a workflow, but it might not be that effective. We need a plan on how to increase in n8n usage overtime while limiting the memory issue.
Alternatively we can look a hosting n8n in multiple locations. Instances with heavy use of n8n can self host their own n8n, while smaller instances can still use the common n8n server.
Well theses are some thoughts as of now. Need to brainstorm and check what other options we have.
Task List:
As some of their producers would like to communicate directly with the customer about their order.
Producers
e.g. - Email
https://openfoodnetwork.slack.com/archives/CG7NJ966B/p1680037636709299
e.g. Number of dev days. Note contributing instances/partners.
Basically - as a supplier to multiple hubs, I need a dashboard to help me manage products (import/export), track my opening stock balance, add in more stock as things are ready in the field, track how much stock has sold in multiple order cycles (I'm thinking 3 OCs - 1 in hub A and 2 order cycles - current week + next week) in hub B.), and calculate how much of my opening + newly added stock is available for sale across these OCs.
Key requirements (added after convo with Theresa)
Producers
Airtable
https://openfoodnetwork.slack.com/archives/C04U02X3806/p1681411299156449
Proposed solution: Building a dashboard in Airtable with features mentioned below.
Method: Use Products API and Postgres DB calls via n8n to get all the relevant data and to run the automations/updates, while keeping all the data in Airtable to simplify searching, filtering, and editing the data.
Features:
Estimate for test: 5-7 hours (a successful test would roughly complete 30% of the total workload for this issue).
Remaining tasks would involve setting up airtable dashboard, setting up n8n workflows (production), and testing with data from actual enterprises and hubs.
Place for @div-yansh-1 to note how he's going with documentation of integrations
UK zapier hosts some automation around dev recruitment:
e.g. - Shoppers - Hub Managers (MCFEs) - Producers - Instance Managers - Other (Please specify)
OFn Core team
e.g. - Email, Instagram, Airtable, Google Sheets. Only mention tools that you are certain of. If the user needs an email sent then 'email' will be a tool, though other tools (eg N8N, Zapier, API) are implementation decisions.
Google forms, email, slack
e.g. - Chats in Slack, Discourse etc
e.g. Number of dev days. Note contributing instances/partners.
Specs/requirements being gathered now - could be based on current Zapier integrations in use in the UK (and elsewhere?).
Creating customers on OFN USA from the customer list csv file provided by a hub.
Notes:
In addition to the communication already done with instances (via Slack, Discourse) it would be good to actually be able to monitor the state in which a given feature is at, in terms of roll-out (which actors, percentage, fully enabled/disabled).
Metabase, N8N, code-changes on ofn-install (Ansible)
Delivery circle meeting from 04.04.2023
WIP, to be discussed: Metabase vs N8N vs. Ansible
Describe the bug
Issue 1 - the export file is NOT capturing all the products in the enterprise product list. Products that are missing all have one thing in common. On the product list, they are showing an import date. All products, on my product list, showing an import date, are not included in the export file. All products, on my product list, without an import date, are included in the export file. (SO - maybe previously imported products are not included in the current n8n download?)
Issue 2 - for this recent export David used a unique login for an enterprise called Garden Party (162) (thats the enterprise I want the export for) But SOME products (and not all) from 2 other enterprises were included in the export file also. The export for this unique login included products from Garden Party Plants (333) and Garden Party Flower Farm (243). Those 2 enterprise (333 & 243) have given enterprise 162 permission for 'everything', so perhaps this is why some of their products got included?
I've tried to figure out why some of these 'other enterprise' products are being included in the export file, but others are not and i can't see anything that defines them.
But for now - it seems that when doing the n8n export file for a given enterprise, that enterprise needs to have 1. a unique login, and ALSO 2. no other enterprise has given 'everything' permissions.
How did you experience it
Running the N8N workflow
Expected behaviour
Ideally it should give a csv file with all the products/variants for an enterprise in the format required for OFN product upload file. This will allow hubs to edit the CSV file with new stock level and upload the same directly on OFN website.
The product list returned should be ALL products for the specified enterprises and no products for enterprises that this enterprise does not have permission to access.
Workflows or tools involved
N8N to CSV export
Link to workflow: https://n8n.openfoodnetwork.org.uk/workflow/55
Additional context
Add any other context about the problem here.
Slack thread
Product export automation in n8n is having some issues. Ideally it should give a csv file with all the products/variants for an enterprise in the format required for OFN product upload file. This will allow hubs to edit the CSV file with new stock level and upload the same directly on OFN website.
Issues mentioned in the slack thread:
Issue 1 - the export file is NOT capturing all the products in the enterprise product list. Products that are missing all have one thing in common. On the product list, they are showing an import date. All products, on my product list, showing an import date, are not included in the export file. All products, on my product list, without an import date, are included in the export file. (SO - maybe previously imported products are not included in the current n8n download?)
Issue 2 - for this recent export David used a unique login for an enterprise called Garden Party (162) (thats the enterprise I want the export for) But SOME products (and not all) from 2 other enterprises were included in the export file also. The export for this unique login included products from Garden Party Plants (333) and Garden Party Flower Farm (243). Those 2 enterprise (333 & 243) have given enterprise 162 permission for 'everything', so perhaps this is why some of their products got included?
I've tried to figure out why some of these 'other enterprise' products are being included in the export file, but others are not and i can't see anything that defines them.
But for now - it seems that when doing the n8n export file for a given enterprise, that enterprise needs to have 1. a unique login, and ALSO 2. no other enterprise has given 'everything' permissions.
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).
Hub Managers
Email, CSV
https://openfoodnetwork.slack.com/archives/C04U02X3806/p1679964247999209
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:
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:
10-12 hrs
Scope/Exact details are being worked out at the moment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.