02 Feb 2024 07:05 PM - last edited on 07 Feb 2024 08:33 AM by MaciejNeumann
Hello everybody
I'm setting up a simple workflow with the following flow:
job_test: executes the query below:
fetch logs, from: -1d
| filter contains(content, "Job_OK_Test")
| summarize count()
And the result if positive is:
In the next step, send_messafe_ok
I configured the following condition: "{{ result("job_test").records | length > 0 }}"
But I believe I'm skipping a step, because it's not matching and the flow stops with the following error:
Error evaluating custom condition - Attempting to use result of unfinished task. Please make job_test a predecessor of send_message_ok.
If anyone can share something I would be grateful.
Tks
Solved! Go to Solution.
15 Feb 2024 02:20 PM
For it to work we need to adjust the DQL as follows:
Example:
fetch logs, from: -10h
| filter contains(content, "Finalizado DesativarAnunciosPJSemAtualizacaoJob")
| summarize execute = count()
| FieldsAdd response = if(execute > 0, "true",else:"false")
And the result will show true or false, and this value we will set the condition for sending the message:
Condition Send Message OK:
{{ result("job_desativa_anuncio_pj").records[0].response == 'true' }}
Condition Send Message Fail:
{{ result("job_desativa_anuncio_pj").records[0].response == 'false' }}