Skip to content

cludden/protoc-gen-go-temporal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protoc-gen-go-temporal

Docs GoDoc Buf Static Badge for Temporal Code Exchange

A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows Workflow authors to configure sensible defaults and guardrails, simplifies the implementation and testing of Temporal workers, and streamlines integration by providing typed client SDKs and a generated CLI application.

Inspired by Chad Retz's awesome github.com/cretz/temporal-sdk-go-advanced and Jacob LeGrone's excellent Replay talk on Temporal @ Datadog

How it works

  1. Annotate your protobuf services and methods with Temporal options provided by this plugin
  2. Generate Go code that includes types, methods, and functions for implementing Temporal clients, workers, and cli applications
  3. Define implementations for the required Workflow and Activity interfaces
  4. Run your Temporal worker using the generated helpers and interact with it using the generated client and/or cli

Features

Generated Client with:

  • methods for executing workflows, queries, signals, and updates
  • methods for cancelling or terminating workflows
  • default client.StartWorkflowOptions, client.UpdateWorkflowWithOptionsRequest, and more
  • dynamic workflow ids, update ids, and search attributes via Bloblang expressions
  • default timeouts, id reuse policies, retry policies, wait policies, and more

Generated Worker resources with:

  • functions for calling activities and local activities from workflows
  • functions for executing child workflows and signaling external workflows
  • default workflow.ActivityOptions, workflow.ChildWorkflowOptions
  • default timeouts, parent close policies, retry policies, and more

Optional CLI with:

  • commands for executing workflows, synchronously or asynchronously
  • commands for starting workflows with signals or updates, synchronously or asynchronously
  • commands for querying existing workflows
  • commands for signaling or updating existing workflows
  • typed flags for conveniently specifying workflow, query, and signal inputs

Generated Nexus helpers: [Experimental]

  • with support for invoking a service's workflows via Nexus operations

Generated Cross-Namespace (XNS) helpers:

  • with support for invoking a service's workflows, queries, signals, and updates from workflows in a different temporal namespace (or cluster)

Generated Remote Codec Server helpers

Generated Markdown Documentation

Documentation

See the documentation for guides on how to configure and use this plugin.

Development

  1. Install mise
  2. Update generated code
mise r build && mise r genlocal
  1. Run tests
mise r test

License

Licensed under the MIT License
Copyright for portions of project cludden/protoc-gen-go-temporal are held by Chad Retz, 2021 as part of project cretz/temporal-sdk-go-advanced. All other copyright for project cludden/protoc-gen-go-temporal are held by Chris Ludden, 2025.

About

a protoc plugin for generating Temporal clients and workers in Go from protobuf schemas

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8