Block Until Done - Cannot access file because it is being used by another process
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My workflow is shown error code as "unable to open file for write: Cannot access file because it is being used by another process". I suspect it's related to the block until done tool that's being placed. The weird thing is that every time I have the same error code but shown on different output. I have a block until done tool inserted in front of all the outputs. Can someone please help?
 
 
Solved! Go to Solution.
- Labels:
- AMP Engine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@wenyg Are you trying to write to the same file in multiple outputs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @wenyg
You have two ( in the first screen) parallel flows with the tools Block Until Done and the order between these flows can not be controlled. You need to modify the workflow so all flows will be coming from one Block Until Done tool. But this will require a lot of modification in your workflow. I would suggest another alternative - Parallel Block Until Done. This is a special macro that should solve your problem
You can download the package with macros from here http://www.chaosreignswithin.com/p/macros.html
After installing you will find a new tool palette together with other tools including Parallel Block Until Done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
In case this helps:
There is also a trick (specific use) of BUD tool with AMP for workflows with multiple parallel branches. It's documented here: https://help.alteryx.com/current/designer/alteryx-engine-and-amp-main-differences
place the BUD tool in the workflow branch with the lowest numbered Input tool ID. This ensures every subsequent branch waits to run until the previous branch is done and the tool works as expected. (click on each Input tool to see the Tool ID in the Configuration pane).
Parallel Branch Execution and Tool Run Order
Some workflows read from a file and then write back to it. This requires sequencing to ensure that the read is complete before the write can start. Similarly, a workflow that wants to write several sheets in one XLSX file needs to write the sheets one at a time. Alteryx Designer provides a Block Until Done (BUD) tool to help partition the work into phases that won’t get in each other’s way.
Same workaround is applicable for Email tool when you use output file(s) from previous branch(es) as attachment. You need to wait once data processing is complete and then add as attachment to the Email tool.
When you work on a workflow with multiple branches (largely separate streams from inputs to outputs), place the BUD tool in the workflow branch with the lowest numbered Input tool ID. This ensures every subsequent branch waits to run until the previous branch is done and the tool works as expected.
Sr. Product Manager, cloud App Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, thank you for the help. I have just used the parallel BUD tool to replace the two BUD tools that you circled. It ran successfully once but now it encountered the same problem again. Where can I put the parallel BUD tool in this case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
With AMP you must put any Block Until Done tools in the branch with the lowest numbered Input tool ID, otherwise AMP will run things in parallel at the same time. That is how it is designed.
Sr. Product Manager, cloud App Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I ran as if the original version rather than AMP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@wenyg you have 3 flows. With one parallel BUD tool, as you have in your screenshot, you do not control the order between 1 and 2, but only between 1/2 and 3. You need to add one more parallel BUD tool. So it should look like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Additional suggestions can be found here: https://knowledge.alteryx.com/index/s/article/Error-writing-Excel-file-to-Shared-Drive
Sr CSE
Alteryx
