Temporal workflow activities for dispatching arbitrary Go functions. Uses a registry to map function names to implementations at runtime, executing them as Temporal activities that compose with the generic orchestration patterns in the workflow package.
- Function Registry — register named Go functions for Temporal dispatch
- Type-safe payloads — implements
workflow.TaskInputandworkflow.TaskOutput - Composable — use with Pipeline, Parallel, Loop, and DAG workflows
- Builder API — fluent construction of function workflow inputs
- Pre-built patterns — common function orchestration patterns included
- Function Workflows Guide — comprehensive usage guide with examples
- Architecture — how this package fits in the overall system
- Workflow Patterns — orchestration patterns
- Getting Started — quick start guide
// Register a handler
registry := function.NewRegistry()
registry.Register("greet", func(ctx context.Context, input function.FunctionInput) (*function.FunctionOutput, error) {
name := input.Args["name"]
return &function.FunctionOutput{
Result: map[string]string{"greeting": fmt.Sprintf("Hello, %s!", name)},
}, nil
})
// Execute via Temporal
input := function.FunctionExecutionInput{
Name: "greet",
Args: map[string]string{"name": "World"},
}