Hi,
I'm using a macro - it executes following Run Command tools ordered by block until done and has to create folder (1st .bat file), run a report in Business Objects (2nd .bat file), save it for further use in workflow and delete all files (3rd .bat file) from share drive. I duplicated this macro to do the same thing for two separate reports and workflow runs normally with this setup. Later in process I'm using another Run Command tool with slightly different setup (delete file instead of directory). I download these reports with macros, process them and then save as separate files. One of them should have two tabs - and while 2nd is created, Alteryx is creating .bak file for spreadsheet. It's redundant and almost equal in size to basic file, so i tried to delete it with this fourth Run Command Tool. Unfortunately, It multipies workflow runtime 3x and strange thing is happening: workflow is executing first macro with all 3 .bat files sequentially, but when it comes to 2nd report Alteryx is waiting until my added Run Command tool (4th) will be executed and then executes last Run Command in 2nd macro. All tools after are completed and Alteryx seems to get back to run this procedure.
I'm not sure why is that happening - maybe Alteryx differentiate Run command tools by procedure and executes delete directory/delete file as last? I even created 'dead end' version where workflow is not using data stream from this 2nd report in following tools (just saves a file) but still .bak file deletion is last. Could you please explain me how to get things in order here? Why workflow suspends executing macro, proceeds with other tools and get back to finish after another delete tool is completed?
Below you can find slightly modified log and attached screenshot of a workflow.
Started running workflow v8.yxmd at Tue Jul 12 08:13:31 2022
00:00:01.270 - ToolId 64: Config file with 2 records were read from Config file path on share drive
00:00:01.274 - ToolId 67: 1 records were True and 1 were False
00:00:01.277 - ToolId 71: 1 target records generated 1 output records
00:00:01.429 - Alteryx: Folder Generator.bat|1 records were written to Folder Generator.bat
00:00:02.168 - Alteryx: Report Generator.bat|1 records were written to Report Generator.bat
00:02:30.401 - Alteryx: Delete Processing File.bat|1 records were written to Delete Processing File.bat - this part for 2nd report is executed on the end
00:02:30.842 - ToolId 72: 1 target records generated 1 output records
00:02:30.980 - Alteryx: Folder Generator.bat|1 records were written to Folder Generator.bat
00:02:31.694 - Alteryx: Report Generator.bat|1 records were written to Report Generator.bat
here should be executed last .bat file in macro
00:03:28.387 - ToolId 50: first report.xlsx|45335 records were written to "first output.xlsx" (first tab) 00:03:28.405 - ToolId 10: 262 records were True and 45073 were False
00:03:28.415 - ToolId 12: 158 records were joined with 2 un-joined left records and 104 un-joined right records
00:03:28.446 - ToolId 52: 160 records were written to 2nd report.xlsx
00:03:28.693 - ToolId 56: 262 records were written to 2nd output report (2nd tab)
00:03:28.965 - ToolId 99: 45335 records were summarized to 1 groups
00:03:29.110 - ToolId 100: DelFiles.bat|1 records were written to DelFiles.bat - this is 4th .bat file outside of these macros
00:25:51.469 - Alteryx: Delete Processing File.bat|1 records were written to Delete Processing File.bat and this is the missing part of 2nd macro, 22 minutes later
Finished in 00:25:52.129
You can use batch macros to ensure Alteryx executes tools in the order you want. Take a look at the previous discussions on controlling the order of operations in Alteryx. Here's a good one: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Controlling-the-Order-of-Operations...