Hello world: Vihren v0.1.0
Typed Temporal code generation, the runnable
codegenhello example, and embedded Temporal for
local development.
Go + Temporal + typed generated glue
Vihren generates typed activity proxies, workflow clients, and worker registration code for Go projects that use Temporal.
//go:generate go run ../../cmd/vihren-gen --manifest .cache/codegenhello.manifest.json ./examples/codegenhello
func HelloWorkflow(ctx workflow.Context, input GreetingInput) (GreetingOutput, error) {
options := workflow.ActivityOptions{StartToCloseTimeout: time.Minute}
ctx = workflow.WithActivityOptions(ctx, options)
return Activity.ComposeGreeting(ctx, input)
}
Write plain Go workflows and activities, then let the generator produce the typed registration, activity proxy, and client entry points that workers and callers use.
func (activityProxy) ComposeGreeting(ctx workflow.Context, input GreetingInput) (GreetingOutput, error) {
var result GreetingOutput
err := workflow.ExecuteActivity(ctx, ComposeGreetingActivityName, input).Get(ctx, &result)
return result, err
}
func (c Client) HelloWorkflow(ctx context.Context, options client.StartWorkflowOptions, input GreetingInput) (client.WorkflowRun, error) {
return c.Client.ExecuteWorkflow(ctx, options, HelloWorkflowName, input)
}
The example runs against an embedded Temporal server so the workflow path can be exercised locally without a separate service.
The local server is process-owned and closes with the example.
Activities and workflows are registered from generated code.
Workflow calls use generated names and Go input types.
func Register(r interface {
RegisterActivityWithOptions(a any, options activity.RegisterOptions)
RegisterWorkflowWithOptions(w any, options workflow.RegisterOptions)
}) {
RegisterActivities(r)
RegisterWorkflows(r)
}
server, err := embeddedtemporal.Start()
if err != nil {
return err
}
defer server.Close()
The v0.1 path is intentionally small: install the module, run the embedded Temporal example, and inspect the generated file.
go get github.com/vihren-dev/vihren
go install github.com/vihren-dev/vihren/cmd/vihren-gen@latest
go run ./examples/codegenhello/cmd/codegenhello-embedded
Hello, Ada
Launch notes and engineering writeups for the public Vihren surface, starting with the hello-world launch note.
Typed Temporal code generation, the runnable
codegenhello example, and embedded Temporal for
local development.
No hosted service, no signup flow, and no product claims beyond the code that ships in the public repository.