Skip to main content

Workflow Definitions

Support, stability, and dependency info

Our Docs modernization effort is underway. New documentation will co-exist alongside our current docs content. We're rebuilding the docs for better organization and engagement so you can find what you need to know with clear unambiguous communication.

  • This page has not been reviewed for SEO
  • This page contains re-used elements with some rewording and restructuring
  • This page probably does not belong in this section.

A Workflow Definition is code that defines how a Workflow functions. You write your definitions in your preferred programming languages using Temporal's suite of SDKs. A Workflow Definition (sometimes referred to as a Workflow Function) encompasses the end-to-end series of steps of a Temporal application. It has one entry point and takes a custom payload as input. Depending on the programming language, the Workflow Definition is typically a function or object method.

Supported development languages

Below are different ways to develop a basic Workflow Definition using our existing SDKs. Although it's possible to use an unsupported language to develop a Temporal application we advise against it. It's much harder and you'll have fewer resources to call on in our community.

Workflow Definition in Go

func YourBasicWorkflow(ctx workflow.Context) error {
// ...
return nil
}

Developer guides

Our Temporal SDK developer guides provide comprehensive overviews of the structures, primitives, and features used in your Temporal Application Workflow Definition development. Here are links to each of the guides and their API references:

Hands on Workflow Definition learning

To learn more about creating Workflows Definitions, visit our courses. Each course provides guided introductions to many of these elements with an expert instructor:

Additional community support

Reach out to others in our Temporal community to learn and grow as a developer:

Terminology Trivia

In practice, a Workflow Definition and a Workflow Function are basically the same thing. If you dive deeper, you'll uncover the nuanced distinctions between the two:

  • A Workflow Definition refers to the code source managed by a Workflow Execution. A Workflow Execution is a complete process, which runs from start to completion. The Workflow Definition runs once per execution.
  • A Workflow Function refers to the source for the instance of a Workflow Function Execution. Temporal may invoke a Workflow Function Execution more than once during the lifetime of a Workflow Execution, normally during replays.