GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - open-workflow-specification/sdk-java: Java SDK for Serverless Workflow

BranchesTags
Open more actions menu

Latest commit

 

History

1,671 Commits
1,671 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
annotations
annotations
 
 
api
api
 
 
bom
bom
 
 
examples
examples
 
 
fluent
fluent
 
 
generators
generators
 
 
impl
impl
 
 
mermaid
mermaid
 
 
serialization
serialization
 
 
types
types
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitpod.Dockerfile
.gitpod.Dockerfile
 
 
.gitpod.yml
.gitpod.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
README.md
README.md
 
 
code-of-conduct.md
code-of-conduct.md
 
 
maintainer_guidelines.md
maintainer_guidelines.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Gitpod ready-to-code FOSSA Status

Open Workflow Specification - Java SDK

Provides the Java API for the Open Workflow Specification

With the SDK you can:

  • Read workflow JSON and YAML definitions
  • Write workflow definitions in JSON and YAML formats.
  • Test your workflow definitions using the reference implementation.

Status

Latest Releases Conformance to spec version
7.x v1.0.0
5.x v0.8
4.x v0.8
3.0.0.Final v0.7
2.0.0.Final v0.6
1.0.3.Final v0.5

Note: 6.0.0.Final (planned for spec v0.9) is intentionally skipped to leave room for anyone who wants to work on it.

JDK Version

SDK Version JDK Version
8.0.0 and after 21
7.0.0 and after 17
5.0.0 and after 11
4.0.x and before 8

Getting Started

Building SNAPSHOT locally

To build project and run tests locally:

git clone https://github.com/open-workflow-specification/sdk-java.git
mvn clean install

The project uses Google's code styleguide. Your changes should be automatically formatted during the build.

Maven projects:

Add the following dependencies to your pom.xml dependencies section:

<dependency>
    <groupId>org.openworkflow.sdk</groupId>
    <artifactId>openworkflow-api</artifactId>
    <version>RELEASE_VERSION</version>
</dependency>

Gradle projects:

Add the following dependencies to your build.gradle dependencies section:

implementation("org.openworkflow.sdk:openworkflow-api:RELEASE_VERSION")

How to Use

There are, roughly speaking, two kind of users of this SDK:

  • Those ones interested on implementing their own runtime using Java.
  • Those ones interested on using the provided runtime reference implementation.

Implementing your own runtime

For those ones interested on implementing their own runtime, this SDK provides an easy way to load an in memory representation of a given workflow definition. This in-memory representation consists of a hierarchy of POJOS directly generated from the Open Workflow specification schema, which ensures the internal representation is aligned with the specification schema. The root of the hierarchy is org.openworkflow.sdk.api.types.Workflow class

Reading workflow definition from JSON/YAML source

You can read a Workflow definition from JSON/YAML source:

Let's say you have a simple YAML based workflow definition in a file name simple.yaml located in your working dir:

document:
  dsl: 1.0.0-alpha1
  namespace: default
  name: implicit-sequence
do:
  setRed:
    set:
      colors: '${ .colors + [ "red" ] }'
  setGreen:
    set:
      colors: '${ .colors + [ "green" ] }'
  setBlue:
    set:
      colors: '${ .colors + [ "blue" ] }'

To parse it and get a Workflow instance you can do:

try (InputStream in = new FileInputStream("simple.yaml")) {
   Workflow workflow = WorkflowReader.readWorkflow (in, WorkflowFormat.YAML);
   // Once you have the Workflow instance you can use its API to inspect it
}

By default, Workflows are not validated against the schema (performance being the priority). If you want to enable validation, you can do that by using:

try (InputStream in = new FileInputStream("simple.yaml")) {
   Workflow workflow = WorkflowReader.validation().readWorkflow (in, WorkflowFormat.YAML);
   // Once you have the Workflow instance you can use its API to inspect it
}

For additional reading helper methods, including the one to read a workflow definition from classpath, check WorkflowReader class.

Writing workflow definition to a JSON/YAML target

Given a Workflow instance, you can store it using JSON or YAML format. For example, to store a workflow using json format in a file called simple.json, you write

try (OutputStream out = new FileOutputStream("simple.json")) {
    WorkflowWriter.writeWorkflow(out, workflow, WorkflowFormat.JSON);
}

For additional writing helper methods, check WorkflowWriter class.

Jackson dependency

The openworkflow-api module depends heavily on Jackson for loading file content into an in-memory POJO. For users who use a JSON handling library other than Jackson, the openworkflow-types module contains Java POJOs generated from the OpenWorkflow schema without any Jackson annotations. Using this module as a dependency, they can build a reader/writer module equivalent to openworkflow-api with their preferred JSON library.

Reference implementation

The reference implementation provides a ready-to-use runtime that supports the Open Workflow Specification. It includes a workflow execution engine, validation utilities, and illustrative examples to help you quickly test and deploy your workflows. For details on usage, configuration, and supported features, see readme.

License

FOSSA Status

Third-Party Code Attributions

This project contains source code copied and modified from the following third-party project:

  • Name: std-uritemplate
  • Source: std-uritemplate GitHub Repository
  • File Copied: java/src/main/java/io/github/stduritemplate/StdUriTemplate.java
  • License: Apache License 2.0
  • Copyright: Copyright 2024-2026 std-uritemplate contributors

About

Java SDK for Serverless Workflow

serverlessworkflow.io

Topics

cncfjavasdkserverlessserverless-workflowworkflow

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

114 stars

Watchers

6 watching

Forks

65 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.