Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Block Until Done - Cannot access file because it is being used by another process

wenyg
8 - Asteroid

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? 

d943265e11541d11c6cb48fb83e2bac.jpg

a5ed45a721627e251bdf4cd5290d4bc.jpg

8 REPLIES 8
JagdeeshN
12 - Quasar
12 - Quasar

@wenyg  Are you trying to write to the same file in multiple outputs?

vlad_kutateladze
8 - Asteroid

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 

vlad_kutateladze_0-1667582244633.png

 

 

You can download the package with macros from here http://www.chaosreignswithin.com/p/macros.html

 

 

vlad_kutateladze_1-1667582916470.png

 

After installing you will find a new tool palette together with other tools including  Parallel Block Until Done. 

 

vlad_kutateladze_2-1667583012815.png

 

 

 

TonyaS
Alteryx
Alteryx

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). 

TonyaS_0-1667601504075.png

 

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.

Tonya Smith
Sr. Technical Product Manager, cloud App Builder
wenyg
8 - Asteroid

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?

0f64b636bacb833047d6ddbf81e3e27.jpg

TonyaS
Alteryx
Alteryx

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. 

Tonya Smith
Sr. Technical Product Manager, cloud App Builder
wenyg
8 - Asteroid

I ran as if the original version rather than AMP.

vlad_kutateladze
8 - Asteroid

@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 

 

vlad_kutateladze_0-1668084499465.png

 

EdP
Alteryx
Alteryx

Additional suggestions can be found here:  https://knowledge.alteryx.com/index/s/article/Error-writing-Excel-file-to-Shared-Drive

Ed Phelps
Sr CSE
Alteryx
Labels