Orkes logo image
Product
Platform
Orkes Platform thumbnail
Orkes Platform
Orkes Agentic Workflows
Orkes Conductor Vs Conductor OSS thumbnail
Orkes vs. Conductor OSS
Orkes Cloud
How Orkes Powers Boat Thumbnail
How Orkes Powers BOAT
Try enterprise Orkes Cloud for free
Enjoy a free 14-day trial with all enterprise features
Start for free
Capabilities
Microservices Workflow Orchestration icon
Microservices Workflow Orchestration
Enable faster development cycles, easier maintenance, and improved user experiences.
Realtime API Orchestration icon
Realtime API Orchestration
Enable faster development cycles, easier maintenance, and improved user experiences.
Event Driven Architecture icon
Event Driven Architecture
Create durable workflows that promote modularity, flexibility, and responsiveness.
Human Workflow Orchestration icon
Human Workflow Orchestration
Seamlessly insert humans in the loop of complex workflows.
Process orchestration icon
Process Orchestration
Visualize end-to-end business processes, connect people, processes and systems, and monitor performance to resolve issues in real-time
Use Cases
By Industry
Financial Services icon
Financial Services
Secure and comprehensive workflow orchestration for financial services
Media and Entertainment icon
Media and Entertainment
Enterprise grade workflow orchestration for your media pipelines
Telecommunications icon
Telecommunications
Future proof your workflow management with workflow orchestration
Healthcare icon
Healthcare
Revolutionize and expedite patient care with workflow orchestration for healthcare
Shipping and logistics icon
Shipping and Logistics
Reinforce your inventory management with durable execution and long running workflows
Software icon
Software
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean leo mauris, laoreet interdum sodales a, mollis nec enim.
Docs
Developers
Learn
Blog
Explore our blog for insights into the latest trends in workflow orchestration, real-world use cases, and updates on how our solutions are transforming industries.
Read blogs
Check out our latest blog:
Conductor CLI Guide: Register, Run, Retry, and Recover Durable Workflows Without Leaving Your Terminal šŸ’»
Customers
Discover how leading companies are using Orkes to accelerate development, streamline operations, and achieve remarkable results.
Read case studies
Our latest case study:
Twilio Case Study Thumbnail
Orkes Academy New!
Master workflow orchestration with hands-on labs, structured learning paths, and certification. Build production-ready workflows from fundamentals to Agentic AI.
Explore courses
Featured course:
Orkes Academy Thumbnail
Events icon
Events
Videos icons
Videos
In the news icon
In the News
Whitepapers icon
Whitepapers
About us icon
About Us
Pricing
Get a demo
Signup
Slack FaviconDiscourse Logo icon
Get a demo
Signup
Slack FaviconDiscourse Logo icon
Orkes logo image

Company

Platform
Careers
HIRING!
Partners
About Us
Legal Hub
Security

Product

Cloud
Platform
Support

Community

Docs
Blogs
Events

Use Cases

Microservices Workflow Orchestration
Realtime API Orchestration
Event Driven Architecture
Agentic Workflows
Human Workflow Orchestration
Process Orchestration

Compare

Orkes vsĀ Camunda
Orkes vsĀ BPMN
Orkes vsĀ LangChain
Orkes vsĀ Temporal
Twitter or X Socials linkLinkedIn Socials linkYouTube Socials linkSlack Socials linkGithub Socials linkFacebook iconInstagram iconTik Tok icon
Ā© 2026 Orkes. All Rights Reserved.
Back to Blogs

Table of Contents

Share on:Share on LinkedInShare on FacebookShare on Twitter
Worker Code Illustration

Get Started for Free with Dev Edition

Signup
Back to Blogs
PRODUCT

What are workflows? A recipe analogy

Orkes Team
Developer Relations
Last updated: April 18, 2022
April 18, 2022
5 min read

Related Blogs

Fail Fast, Recover Smart: Timeouts, Retries, and Recovery in Orkes Conductor

May 12, 2025

Fail Fast, Recover Smart: Timeouts, Retries, and Recovery in Orkes Conductor

Task-Level Resilience in Orkes Conductor: Timeouts and Retries in Action

May 12, 2025

Task-Level Resilience in Orkes Conductor: Timeouts and Retries in Action

Workflow-Level Resilience in Orkes Conductor: Timeouts and Failure Workflows

May 12, 2025

Workflow-Level Resilience in Orkes Conductor: Timeouts and Failure Workflows

Ready to Build Something Amazing?

Join thousands of developers building the future with Orkes.

Start for free

What is a workflow? Wikipedia says "A workflow consists of an orchestrated and repeatable pattern of activity, enabled by the systematic organization of resources into processes that transform materials, provide services, or process information."

None of that is incorrect. But it is certainly a mouthful. If I am asked in an elevator what a workflow orchestration is, I like to use analogies to make the point as approachable as possible:

"It's like a recipe for code. A recipe has a series of steps, that must be run in a specific order. Iyt can also have different options for food allergies, or different ingredients you might have on hand? A workflow is a recipe for your code, and can be built to handle many of the changes that might reasonably occur when the code runs."

Workflows as recipes

You may have seen one of the name videos out there of parents teaching kids code by writing out the steps to create a Peanut butter and Jelly sandwich.

We're not going to be quite as silly as that Dad, but we'll run through some instructions on how to create a PB&J from Instructables..

If you look at the URL of that recipe - it appears it took 4 tries to get it right :D https://www.instructables.com/How-to-Make-a-Peanut-Butter-and-Jelly-Sandwich-4/

The steps are (skipping some substeps for clarity):

  1. Gather Your Ingredients for the Sandwich
  2. Pull Out Two Slices of Bread
  3. Open Peanut Butter and Jelly
  4. Spread the Peanut Butter Onto One Slice of Bread
  5. Spread the Jelly Onto the Other Slice of Bread
  6. Combine the Two Slices
  7. Clean Up Your Workspace
  8. Enjoy Your Sandwich

(if you read closely, I skipped 3 steps - wearing gloves, removing the crust and cutting the sandwich in half... because, well - that's all just ridiculous)

The eight steps above are a workflow. They must be performed in that order to create a sandwich - you cannot spread the PB before you lay out the bread.

Building a Conductor Workflow

We can turn these 8 steps into a Conductor workflow.

PB&J example workflow

This workflow shows clear steps with arrows pointing to the next step - so it is visually possible to see how the workflow will progress.

Improving the workflow

Each task is run by a microservice, so making changes and adding tasks is easy to do. In this example - you see that the recipe calls for PB to be spread first, and then the jelly. This works for a single human - these steps each take 2 hands. But there is no reason that the jelly cannot go first, and THEN the PB. Or - if you had more hands - the PB and the Jelly could be spread simultaneously.

Independent tasks

Let's remove the PB dependency from the jelly spreading - as the order of PB vs. jelly does not matter.

We can do this in Conductor with a Fork. A fork splits your workflow into 2 asynchronous tasks, and then a Join reconnects the the workflow into a single path.

We can now apply a fork to apply PB, and a second fork to apply the jelly:

PB&J example workflow

This is version 2 of the workflow.

Now, these operations are independent, and if there is space in the jelly task queue - that can be completed ahead of the PB.

Recipe variations

Often, recipes have variations to preparation, and they can be read like an IF statement in programming if (fresh tomatoes) do something, else if (tinned tomatoes) do somethingelse

Cooking a burrito

Let's look at a common example - from a burrito in my freezer. The preparation directions vary depending on the cooking method.

PB&J example workflow

We can emulate this in a workflow using a switch task. The Switch task takes in the workflow ovenType input ${workflow.input.ovenType} and based on this value will make a decision. The default case is for the microwave, and then second decisionCase is set to "oven". From that input, the different tasks can be run.

Workflow fork

Conclusion

Workflows are a series of tasks that must be followed in a certain order. In this post, we used cooking recipes as an analogy to a workflow - they too are a series of tasks that must be followed in a certain order.

We created sample workflows for making a peanut and jelly sandwich version 1:

json
{
  "name": "PBJ",
  "description": "Edit or extend this sample workflow. Set the workflow name to get started",
  "version": 1,
  "tasks": [
    {
      "name": "collect_ingredients",
      "taskReferenceName": "collect_ingredients",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "open_bread_bag_place_two_pieces_of_bread_on_plate",
      "taskReferenceName": "open_bread_bag_place_two_pieces_of_bread_on_plate",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "open_PB_open_jelly",
      "taskReferenceName": "open_PB_open_jelly",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "spread_PB_left_slice_of_bread",
      "taskReferenceName": "spread_PB_left_slice_of_bread",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "spread_jelly_right_slice_of_bread",
      "taskReferenceName": "spread_jelly_right_slice_of_bread",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "close_sandwich",
      "taskReferenceName": "close_sandwich",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "clean_up",
      "taskReferenceName": "clean_up",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "eat",
      "taskReferenceName": "eat",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    }
  ],
  "inputParameters": [],
  "schemaVersion": 2
}

and version 2:

json
{
  "name": "PBJ",
  "description": "Edit or extend this sample workflow. Set the workflow name to get started",
  "version": 2,
  "tasks": [
    {
      "name": "collect_ingredients",
      "taskReferenceName": "collect_ingredients",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "open_bread_bag_place_two_pieces_of_bread_on_plate",
      "taskReferenceName": "open_bread_bag_place_two_pieces_of_bread_on_plate",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "fork_join",
      "taskReferenceName": "my_fork_join_ref",
      "inputParameters": {},
      "type": "FORK_JOIN",
      "forkTasks": [
        [
          {
            "name": "open_PB",
            "taskReferenceName": "open_PB",
            "inputParameters": {
              "evaluatorType": "javascript",
              "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
            },
            "type": "INLINE"
          },
          {
            "name": "spread_PB_left_slice_of_bread",
            "taskReferenceName": "spread_PB_left_slice_of_bread",
            "inputParameters": {
              "evaluatorType": "javascript",
              "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
            },
            "type": "INLINE"
          }
        ],
        [
          {
            "name": "open_jelly",
            "taskReferenceName": "open_jelly",
            "inputParameters": {
              "evaluatorType": "javascript",
              "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
            },
            "type": "INLINE"
          },
          {
            "name": "spread_jelly_right_slice_of_bread",
            "taskReferenceName": "spread_jelly_right_slice_of_bread",
            "inputParameters": {
              "evaluatorType": "javascript",
              "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
            },
            "type": "INLINE"
          }
        ]
      ]
    },
    {
      "name": "notification_join",
      "taskReferenceName": "notification_join_ref",
      "inputParameters": {},
      "type": "JOIN",
      "joinOn": ["email_notification_ref", "sms_notification_ref"]
    },
    {
      "name": "close_sandwich",
      "taskReferenceName": "close_sandwich",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "clean_up",
      "taskReferenceName": "clean_up",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "eat",
      "taskReferenceName": "eat",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    }
  ],
  "schemaVersion": 2
}

and another workflow to cook a frozen burrito with microwave or oven instructions:

json
{
  "name": "burrito",
  "version": 1,
  "tasks": [
    {
      "name": "remove_overwrap",
      "taskReferenceName": "remove_overwrap",
      "inputParameters": {
        "evaluatorType": "javascript",
        "expression": "function e() { if (true){return {\"result\": true}} else { return {\"result\": false}}} e();"
      },
      "type": "INLINE"
    },
    {
      "name": "order_checking",
      "taskReferenceName": "switch_task",
      "inputParameters": {
        "switchCaseValue": "${workflow.input.ovenType}"
      },
      "type": "SWITCH",
      "decisionCases": {
        "oven": [
          {
            "name": "preheat_oven",
            "taskReferenceName": "preheat_oven",
            "inputParameters": {
              "temp": "400",
              "units": "F"
            },
            "type": "INLINE"
          },
          {
            "name": "wrap_burrito_in_foil",
            "taskReferenceName": "wrap_burrito_in_foil",
            "inputParameters": {
              "temp": "400",
              "units": "F"
            },
            "type": "INLINE"
          },
          {
            "name": "bake",
            "taskReferenceName": "initial_bake",
            "inputParameters": {
              "time": "20"
            },
            "type": "INLINE"
          },
          {
            "name": "flip",
            "taskReferenceName": "flip_burrito_oven",
            "inputParameters": {},
            "type": "INLINE"
          },
          {
            "name": "bake",
            "taskReferenceName": "second_bake",
            "inputParameters": {
              "time": "20"
            },
            "type": "INLINE"
          },
          {
            "name": "remove_foil",
            "taskReferenceName": "remove_foil",
            "inputParameters": {
              "temp": "400",
              "units": "F"
            },
            "type": "INLINE"
          }
        ]
      },
      "defaultCase": [
        {
          "name": "place_burrito_on_plate",
          "taskReferenceName": "place_burrito_on_plate",
          "inputParameters": {},
          "type": "INLINE"
        },
        {
          "name": "cover_burrito_with_plate",
          "taskReferenceName": "cover_burrito_with_plate",
          "inputParameters": {},
          "type": "INLINE"
        },
        {
          "name": "zap",
          "taskReferenceName": "initial_zap",
          "inputParameters": {
            "time": "1.5"
          },
          "type": "INLINE"
        },
        {
          "name": "flip",
          "taskReferenceName": "flip_burrito_zap",
          "inputParameters": {},
          "type": "INLINE"
        },
        {
          "name": "zap",
          "taskReferenceName": "second_zap",
          "inputParameters": {
            "time": "1.5"
          },
          "type": "INLINE"
        }
      ],
      "evaluatorType": "value-param",
      "expression": "switchCaseValue",
      "decisionCases": {},
      "defaultExclusiveJoinTask": [],
      "forkTasks": []
    },
    {
      "name": "let_sit",
      "taskReferenceName": "let_sit",
      "inputParameters": {
        "time": "1"
      },
      "type": "INLINE"
    }
  ],
  "schemaVersion": 2
}

We are able to reuse a number of tasks:

  • The zap task is used twice in the microwave branch.
  • The bake task in the oven branch.
  • The flip task is used in both branches.

When reusing tasks, the taskReferenceName (shown at the top of the box) must be unique.

If you're curious about how to build a workflow orchestration - it might be a fun exercise to try your favorite recipe as a workflow. You can build on the workflows from this post in our Developer Edition. Feel free to share what you came up with in our community Slack. We love seeing creative uses of workflows!