Stay organized with collections
Save and categorize content based on your preferences.
A workflow source file can contain only one main workflow and, as a best
practice, we recommend placing your main workflow in a main block.
If a workflow has a subworkflow,
the main workflow must be placed in a main block. Similarly, for a workflow
to receive runtime arguments
there must be a main block.
Inside the main workflow, you can define the
steps you want and their order of
execution using the Workflows syntax. Every workflow must have at least
one step.
[[["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,["# Main workflow\n\nA workflow source file can contain only one main workflow and, as a best\npractice, we recommend placing your main workflow in a `main` block.\n\nIf a workflow has a [subworkflow](/workflows/docs/reference/syntax/subworkflows),\nthe main workflow must be placed in a `main` block. Similarly, for a workflow\nto receive [runtime arguments](/workflows/docs/reference/syntax/runtime-args)\nthere must be a `main` block. \n\n### YAML\n\n```yaml\n main:\n params: [MAP_NAME]\n steps:\n - STEP_NAME:\n ...\n ...\n \n```\n\n### JSON\n\n```json\n {\n \"main\": {\n \"params\": [\n \"\u003cvar translate=\"no\"\u003eMAP_NAME\u003c/var\u003e\"\n ],\n \"steps\": [\n {\n \"\u003cvar translate=\"no\"\u003eSTEP_NAME\u003c/var\u003e\": {\n ...\n }\n },\n ...\n ]\n }\n }\n \n```\n\nInside the main workflow, you can define the\n[steps](/workflows/docs/reference/syntax/steps) you want and their order of\nexecution using the Workflows syntax. Every workflow must have at least\none step."]]