Stay organized with collections
Save and categorize content based on your preferences.
You can use jumps to control what step in your workflow will execute next. For
example, at the end of any step, you can use next to define what step should
execute next:
This sample uses the next: command to explicitly define the sequence of
workflow steps. In this sample, steps are executed in a different order than
they appear in the workflow definition.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Jumps\n\nYou can use jumps to control what step in your workflow will execute next. For\nexample, at the end of any step, you can use `next` to define what step should\nexecute next: \n\n### YAML\n\n```yaml\n - STEP_NAME:\n ...\n next: STEP_NAME_TO_JUMP_TO\n \n```\n\n### JSON\n\n```json\n [\n {\n \"\u003cvar translate=\"no\"\u003eSTEP_NAME\u003c/var\u003e\": {\n ...\n \"next\": \"\u003cvar translate=\"no\"\u003eSTEP_NAME_TO_JUMP_TO\u003c/var\u003e\"\n }\n }\n ]\n \n```\n\nYou can also use `next` to do the following:\n\n- To change the flow of a `for` loop, you can use `next: break` or\n `next: continue`. For more information, see\n [Use break/continue in a loop](/workflows/docs/reference/syntax/iteration#break-in-loop).\n\n- To stop the execution of a workflow or subworkflow, you can use `next: end`.\n For more information, see\n [Complete the execution of a workflow](/workflows/docs/reference/syntax/completing).\n\nFor more information about defining a workflow's order of execution, see\n[Conditions](/workflows/docs/reference/syntax/conditions) and\n[Control the order of execution in a workflow](/workflows/docs/controlling-execution-order).\n\n### Explicit step ordering using jumps\n\nThis sample uses the `next:` command to explicitly define the sequence of\nworkflow steps. In this sample, steps are executed in a different order than\nthey appear in the workflow definition.\n\n### YAML\n\n - first_step:\n call: http.get\n args:\n url: https://www.somewhere.com/callA\n next: second_step\n - third_step:\n call: http.get\n args:\n url: https://www.somewhere.com/callB\n next: end\n - second_step:\n call: http.get\n args:\n url: https://www.somewhere.com/callC\n next: third_step\n\n### JSON\n\n [\n {\n \"first_step\": {\n \"call\": \"http.get\",\n \"args\": {\n \"url\": \"https://www.somewhere.com/callA\"\n },\n \"next\": \"second_step\"\n }\n },\n {\n \"third_step\": {\n \"call\": \"http.get\",\n \"args\": {\n \"url\": \"https://www.somewhere.com/callB\"\n },\n \"next\": \"end\"\n }\n },\n {\n \"second_step\": {\n \"call\": \"http.get\",\n \"args\": {\n \"url\": \"https://www.somewhere.com/callC\"\n },\n \"next\": \"third_step\"\n }\n }\n ]"]]