cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Condition for matching in the workflow

HelderCosta
Frequent Guest

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:

heldercosta82_0-1706900071451.png

 

In the next step, send_messafe_ok
I configured the following condition: "{{ result("job_test").records | length > 0 }}"

heldercosta82_1-1706900296783.png


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.

wf-dyna.png
If anyone can share something I would be grateful.

Tks

1 REPLY 1

HelderCosta
Frequent Guest

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

HelderCosta_0-1708006523307.png


And the result will show true or false, and this value we will set the condition for sending the message:

HelderCosta_1-1708006744477.png

 


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' }}

Featured Posts