Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Running macro from workflow runs differently than running the macro itself

luukve
6 - Meteoroid

Hi all,

 

I have a standard macro which has one input row, containing two columns (a table name and an ID). 

 

I don't know if this is relevant but the macro contains, among others, a Dynamic Input tool which I use to delete records from a SQL Server table. 

In the SQL Editor of this tool I have this query:

 

"Select 1; Delete From [table] Where <condition>;"

 

In the tool configuration, I then replace the string [table] with the table name that I have as input of my macro, and <condition> is replaced by a WHERE clause which I generate inside the workflow.

 

Now, when I run this macro in isolation for a particular table name and ID, it executes the query 115 times (one for each WHERE clause that I have generated). It continues one and does some more stuff. All fine. Takes around 15-20 minutes to finish. 

 

However, here's the problem: when I invoke the macro from another workflow, with the exact same table name and ID, I see that it only executes the query 2 times, and stops after 3 minutes. 

 

Does anyone have any idea why there's a difference between running the macro on its own and invoking it, even though the parameters are exactly the same?

 

10 REPLIES 10
JoeS
Alteryx
Alteryx

Do you have an output from you macro? Make sure you have a browse coming out for Alteryx to populate if you have got a batch macro

 

Do you get a message about ended by downstream tools?

luukve
6 - Meteoroid

Hi, thanks for your reply. 

 

No, my macro does not have a macro output tool in it, though it has some regular output tool which come after the aforementioned Dynamic Input tool.

 

The macro is a standard macro, not a batch macro. 

 

Yes, I get a message about ended by downstream tool. It says the second of the two deletion queries is ended by a downstream tool. 

 

What does this mean?

 

 

luukve
6 - Meteoroid

It does have some regular output data tools in it which follow it, I should add.

luukve
6 - Meteoroid

I mean Dynamic Input tool in OP, not Input Data tool

danilang
19 - Altair
19 - Altair

Hi Luukve

 

Check out the response from @Claje on this thread.  It has to do with the macro stopping because the wf optimization process doesn't "think" the extra iterations are needed anywhere.

 

Dan

 

JoeS
Alteryx
Alteryx

Is there any chance you could upload your macro?

 

@danilang  suspicions are the same as mine, but would be good to check the macro itself to see.

luukve
6 - Meteoroid

That makes sense and was my first thought too. So what can be done?

 

 

luukve
6 - Meteoroid

Sadly I can't upload my workflow due to restrictions from my company.

 

I read the other thread and I should mention that right after my Dynamic Input Tool (with configuration as posted in OP) I immediately do a Sample 1. My macro ends in two branches, both of which are Output Data tools. 

 

Hope that provides some more insight.

 

 

JoeS
Alteryx
Alteryx

Without knowing the exact configuration it will be a bit of guess work, but yeah using a sample and setting it to Last N Records and setting N to 1 may well do the trick!

Labels