Trigger flow On New Or Updated File
File connector provides a listener that polls a directory for files that have been created/updated. A message is generated for each file that is found. Let’s see how we trigger flow on new/updated file.
Create project in Anypoint studio
Drag and drop on New or Updated File from mule palette
Configure the below parameters:
- Directory: provide the directory path
- Matcher: Use a matcher to filter the files
- Watermark: Use the watermark parameter to only pick files that have been created or updated after the last poll was executed by default it is disabled
- Schedule Frequency: configure the frequency to poll the directory
Once the file is processed you can configure below parameters
- Auto Delete: file delete after processing default is false
- Move to directory: configure the directory for processed file
- Rename: rename file after processing
Prepare the test data
Deploy the project and test
As soon as the file is created flow get triggered
Flow get triggered and file is processed successfully
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.
boy thats cool