Relevance to check that an action finished

Hello, I want to run two tasks, one after the other but I cannot use automation as task 1 should run every day at specific time. Also task 1 runs against some targets and task 2 against other targets.

Task 2 will run only if task one has completed minutes or hours before (never days).

is there a relevance that I can use on the second task that says something like

if action name “task/action 1” run today and it is completed, then true else false?

Thanks in advance.

Probably the easiest way is to have Task1 apply a client setting, and Task2’s relevance check the existence and effective date if it.

Task1 action:

setting "Task1Ran"="true" on "{now}" for client

Task2 relevance:

exists setting "Task1Ran" whose (value of it = "true" and now - effective date of it < 24 * hour) of client

Just an idea… have you tried to use the action 1 to create a flag file in your endpoints at the end of its intended actions, and action 2 would read if the file exists, if yes, then its finished, if not then its not yet, therefore not relevant.

We are using this type of flag files to check if data collected for health checks are new or not (using 3rd party collectors that BigFix deploy).

Thank you Jason for the quick response…
now tasks 1 runs for 80 clients "client 1, client 2, client 3…etc)
task 2 runs only for 1 client=“zzzz”

it will be valid to do

Task1 action:

setting “Task1Ran”=“true” on “{now}” for client “zzzz”??

Hello Thank you, I tried that however I am facing a problem
Task 1 runs against 89 servers, task 2 against only 1
However we only need the task to succeed on 1 in order for the second task to run…
the key here is…how do I know that the task for the 89 finished (regardless of how many success or failures I have).
Will I not run the risk of the action becoming relevant after the success of the first target, hence starting the second, when in fact the other 88 servers have not finish yet.

bare in mind that the 89 targets will all be writing/applying something to the flag, but just with one success the flag will be mark.

Hello Anyone that knows how to add a setting to a different target not the target where the task is actually running?

Thanks

I think you need to find a different qay to approach your problem.

Hello Jason, I did and I think I got it…more test will be required but I will keep you posted.
What I did was

In task 1, added the server that is required in Task 2 in the relevance so that it becomes a target
Add a condition to task 1…
parameter “serverstodo” = "{Computer Name}"
if {parameter “serverstodo” != “serverfortask2”}
do the work on the 89 servers
endif
if {parameter “serverstodo” = “serverfortask2”}
setting “Count_Send_Email”=“true” on “{now}” for client
endif

I then created a property with the relevance
if exists settings “Count_Send_Email” whose(“true” = value of it) of client then true else false

Once that it was done I created an action for task 2 that only runs if the property Count_Send_Email is true for the only server that is the target

I run it a couple of times and so far so good.