temporal-serverless-workflow

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README ΒΆ

Temporal Serverless Workflow

Go Report Card

Build Temporal workflows with Serverless Workflow

Loom

Here's a Loom video explaining the idea

Video thumbnail

Why?

We regularly get asked about using a domain-specific language (DSL) to make Temporal workflows in a no/low-code format. For very good reasons, this is outside the scope of the Temporal project. But still they come.

Serverless Workflow is a CNCF-sponsored project to create a vendor-neutral method of defining a workflow.

Architecture

This application is designed to replace the Temporal worker by generating the workflows and activities defined. This will be a long-running application.

Triggering workflows defined by this application will be done in the normal Temporal way - see examples for more information.

Conceptually, the items in the do array of the schema are things that a Temporal workflow can do. Sometimes these will be invoked by the workflow, but most will be activities.

Goals

This project has a number of goals:

  1. Can a Temporal workflow be configured by a DSL?
  2. Should a Temporal workflow be configured by a DSL?
  3. Would this be a useful addition to the Temporal ecosystem?

From a deployment point of view, this is designed as a standalone application. This allows for it to be run in multiple different ways, such as in Kubernetes or on bare metal.

Getting started

Define your workflow

Create a workflow in the Serverless Workflow schema.

An example workflow is provided.

Start your Temporal server

This can be any flavour of Temporal (Cloud or self-hosted). To start a local development server, run:

temporal server start-dev
Run

There are many options available so it's best to look at the available options in the application's help.

go run . -h

At it's simplest, this will be:

go run . --temporal-address localhost:7233 --files ./workflow.example.yaml

It's now ready for all your workflow needs

Running examples

See examples directory

Schema

Variables

Each call receives the input and output from previous calls, so that can be used in calls. This is done using the Go template variable methods - if you set an userId variable, this can be retrieved by adding {{ .userId }} in your schema definition.

Environment variables are also used, provided that the match the prefix - by default, this is TSW_. These can also be parsed - the variable TSW_EXAMPLE_ENVVAR would be retrieved by adding {{ .TSW_EXAMPLE_ENVVAR }} to your schema definition.

Future developments

This is largely dependent upon how much interest there in the community, so please add stars and raise pull requests.

This is a very basic implementation, with only support for the basic Temporal workflow. Things that will be needed to make this a production-grade system (not exhaustive):

Implementation roadmap

The table below lists the current state of this implementation. This table is a roadmap for the project based on the DSL Reference doc.

This project currently only supports DSL 1.0.0.

Feature State
Workflow Document βœ…
Workflow Use 🟑
Workflow Schedule ❌
Task Call 🟑
Task Do βœ…
Task Emit ❌
Task For ❌
Task Fork 🟑
Task Listen 🟑
Task Raise ❌
Task Run ❌
Task Set βœ…
Task Switch βœ…
Task Try ❌
Task Wait βœ…
Lifecycle Events ❌
External Resource ❌
Authentication ❌
Catalog ❌
Extension ❌
Error ❌
Event Consumption Strategies ❌
Retry ❌
Input ❌
Output ❌
Export ❌
Timeout ❌
Duration ❌
Endpoint ❌
HTTP Response ❌
HTTP Request ❌
URI Template ❌
Container Lifetime ❌
Process Result ❌
AsyncAPI Server ❌
AsyncAPI Outbound Message ❌
AsyncAPI Subscription ❌
Workflow Definition Reference βœ…
Subscription Iterator ❌

Contributing

Open in a container
Commit style

All commits must be done in the Conventional Commit format.

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Documentation ΒΆ

Overview ΒΆ

Copyright Β© 2025 Simon Emms <simon@simonemms.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories ΒΆ

Path Synopsis
examples
basic command
listen command
query command
signal command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL