Orquesta workflows || Task sequence

Hi Team,

in Orquesta workflows, we need to run the task as a sequence of UpdateWorklog_Incident then Escalate_Incident . However, it’s running simultaneously.

Please help. how to configure sequence task call.

ping_result_validate:
action: core.noop
next:
- when: “{{ ctx().Ping_failure_msg_len > ctx().Ping_failure_msg_lenCondition }}”
publish:
- error_message: “Device {{ ctx().ci_address }} could not be reached by ping”
- ping_Detail_result: “Result :{{ ctx().Ping_failure_msg}}”
- Incident_Esclation: “Esc”
do:
- UpdateWorklog_Incident
- Escalate_Incident

The workflow as you have ti says to run ping_result_validate, and then it will execute all the conditions under next. So it will do UpdateWorklog_Inclident and Escalate_incident in parallel.

To have it as a seqence, just have UpdateWorklog_incident as the only next listed for ping_result_validate.

Then in your task UpdateWorklog)Incident then you’ll specify that it’s next condition is Escalate_Incident.

Hi

Thanks for the reply,
in the task “ping_result_validate” , we have a variable as “Incident_Esclation”. Based on the “ping_result_validate” result, the variable will publish as ‘Esc’ or ‘Res’. Based on the “Incident_Esclation” value needs to call “Escalate_Incident” or “Resolve_Incident”. if i can i get the value “Incident_Esclation” inside “UpdateWorklog_Incident” .

ping_result_validate:
action: core.noop
next:
- when: “{{ ctx().Ping_failure_msg_len > ctx().Ping_failure_msg_lenCondition }}”
publish:
- error_message: “Device {{ ctx().ci_address }} could not be reached by ping”
- ping_Detail_result: “Result :{{ ctx().Ping_failure_msg}}”
- Incident_Esclation: “Esc”

        do:
          - UpdateWorklog_Incident
          - Escalate_Incident             
      - when: "{{ ctx().Ping_failure_msg_len <= ctx().Ping_failure_msg_lenCondition }}"
        publish:
          - error_message: "Device {{ ctx().ci_address }} is  reachable."
          - ping_Detail_result: "Result :{{ ctx().ping_Detail_result }}" 
          - Incident_Esclation: "Res"
         
        do:
          - UpdateWorklog_Incident
          - Resolve_Incident

So is there a problem with what you have shown above.

This should publish Incident_Escalation in the first branch as “Esc”. Then it will call UpdateWorklog_Incident and Escalate_Incident in parallel. Both of those tasks should have access to what you have published.

Are you getting problems with the yaml you have above?

There is no issue in Yaml to call the both the task in paralle. But we need to call sequence.

So if you want both branches to go first to UpdateWorklog_Incident, then just amend your next on ping_result_validate to go to UpdateWorklog_Incidnet only in both of the dos, e.g.

‘’’

next:
  - when: “{{ ctx().Ping_failure_msg_len > ctx().Ping_failure_msg_lenCondition }}”
    publish:
      - error_message: “Device {{ ctx().ci_address }} could not be reached by ping”
      - ping_Detail_result: “Result :{{ ctx().Ping_failure_msg}}”
      - Incident_Esclation: “Esc”
    do:
      - UpdateWorklog_Incident
              
  - when: "{{ ctx().Ping_failure_msg_len <= ctx().Ping_failure_msg_lenCondition }}"
    publish:
      - error_message: "Device {{ ctx().ci_address }} is  reachable."
      - ping_Detail_result: "Result :{{ ctx().ping_Detail_result }}" 
      - Incident_Esclation: "Res"
   
    do:
      - UpdateWorklog_Incident

Then in UpdateWorklog_Incidnet you would have a next statement with two conditions. You can then test the value of ctx().Incident_Escalation to go to Resolve_Incident or Incident_Escalation, e.g.

next:
  - when: “{{ ctx().Incident_Escalation = 'Esc' }}”
    do:
      - Escalate_Incident
  - when: “{{ ctx().Incident_Escalation = 'Res' }}” 
    do:
      - Resolve_Incident

thanks so much. It’s working.