Skip to content

MercuryTechnologies/hs-temporal-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Unofficial) Haskell Temporal SDK Cookbook

This is a set of examples for the (unofficial) Haskell SDK.

Examples

Most examples assume a Nix development shell and running Temporal development server; see the usage section below for details.

  • hello - basic examples
    • activity - define an activity and execute it from a workflow
    • activity_with_boilerplate - same as above, without using Template Haskell convenience utilities
    • child_workflow - execute a workflow that spawns a child workflow
    • cron - execute a workflow once per minute

Usage

Prerequisites

This cookbook depends on Nix; if you don't already have Nix installed, please follow these instructions to do so.

Running the Examples

Warning

--accept-flake-config should never be passed to a nix command that executes untrusted code; a malicious actor could use it to execute commands as root!

Always validate the nixConfig in a project's flake.nix beforehand; in this case, we're using it to provide cached Garnix CI artifacts.

Unless otherwise specified, all examples require a running Temporal development server; drop into a Nix development shell and spawn one:

$ nix develop --accept-flake-config
$ temporal server start-dev

The development server web UI should now be available at localhost:8233.

Separately, drop into a Nix development shell from which the examples may be compiled and executed; to run the basic activity example:

$ nix develop --accept-flake-config
$ cabal run hello:activity_with_boilerplate

Upon completion, navigate to the web UI and observe that a workflow of type greeting has completed:

Temporal web UI showing workflow execution

About

Cookbook for working with the (Unofficial) Temporal Haskell SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published