0
0
GCPcloud~10 mins

Workflows for orchestration in GCP - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Workflows for orchestration
Start Workflow
Execute Step 1
Check Step 1 Result
Execute Step 2
Check Step 2 Result
Execute Step 3
End Workflow
The workflow starts, executes steps in order, checks results, and handles errors before ending.
Execution Sample
GCP
start:
  call: http.get
  args:
    url: https://example.com/api
  result: response

next:
  switch:
    - condition: ${response.status_code == 200}
      next: success
    - condition: ${true}
      next: failure
This workflow calls an API, checks the response status, and branches based on success or failure.
Process Table
StepActionInput/ConditionResultNext Step
1Start WorkflowNoneWorkflow startedExecute Step 1
2Execute Step 1Call API https://example.com/apiResponse status 200Check Step 1 Result
3Check Step 1 Resultresponse.status_code == 200TrueExecute Step 2
4Execute Step 2Process data from APIData processed successfullyCheck Step 2 Result
5Check Step 2 ResultProcessing successTrueExecute Step 3
6Execute Step 3Finalize workflowWorkflow finalizedEnd Workflow
7End WorkflowNoneWorkflow completed successfullyNone
💡 Workflow ends after all steps succeed without errors.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
response.status_codeundefined200200200200
data.processedfalsefalsetruetruetrue
workflow.statestartedstep1_donestep2_donestep3_donecompleted
Key Moments - 3 Insights
Why does the workflow check the response status after calling the API?
Because the workflow needs to decide the next step based on success or failure, as shown in execution_table row 3.
What happens if the response status is not 200?
The workflow would follow the failure branch to handle errors, but in this trace, it proceeds because the status is 200 (row 3).
How does the workflow know when to end?
It ends after the last step completes successfully, as shown in execution_table row 7.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the response status after Step 1?
A404
B500
C200
Dundefined
💡 Hint
Check the 'Result' column in row 2 of the execution_table.
At which step does the workflow decide to proceed to Step 2?
AStep 1
BStep 3
CStep 5
DStep 4
💡 Hint
Look at the 'Next Step' column in row 3 of the execution_table.
If the API response status was 500, what would happen in the workflow?
AHandle Error after Step 1
BProceed to Execute Step 2
CSkip Step 2 and Step 3
DEnd Workflow immediately
💡 Hint
Refer to the concept_flow where failure after Step 1 leads to error handling.
Concept Snapshot
Workflows run steps in order, checking results after each.
They branch on success or failure to handle errors.
Each step can call services or process data.
The workflow ends when all steps succeed or an error is handled.
Use conditions to control flow and ensure reliability.
Full Transcript
This visual execution shows how a Google Cloud Workflow runs steps one by one. It starts by calling an API, then checks if the response was successful. If yes, it processes data and finalizes the workflow. If any step fails, it handles errors accordingly. Variables like response status and workflow state update after each step. The workflow ends only after all steps succeed or an error is handled. This helps automate tasks reliably by controlling the flow based on results.