Extensions & helpers for setting up a Temporal resource in Aspire.
Find a file
2026-03-31 11:35:26 +02:00
.forgejo/workflows Initial 2026-03-31 09:28:57 +02:00
.idea/.idea.Byrone.Aspire.Temporal/.idea Initial 2026-03-31 09:28:57 +02:00
Byrone.Aspire.Temporal Added several stuffs 2026-03-31 11:35:26 +02:00
TemporalAppHost Added several stuffs 2026-03-31 11:35:26 +02:00
.gitignore Initial 2026-03-31 09:28:57 +02:00
Byrone.Aspire.Temporal.slnx Initial 2026-03-31 09:28:57 +02:00
Directory.Build.props Initial 2026-03-31 09:28:57 +02:00
icon.png Added several stuffs 2026-03-31 11:35:26 +02:00
LICENSE.md Added several stuffs 2026-03-31 11:35:26 +02:00
README.md Added several stuffs 2026-03-31 11:35:26 +02:00

Byrone.Aspire.Temporal icon

Byrone.Aspire.Temporal

Extensions & helpers for setting up a Temporal resource in Aspire.

Usage

It's recommended to use the byrone2/temporal Docker image, as this will automatically handle setting up the PostgreSQL database and namespace creation.

using Byrone.Aspire.Hosting;
using Byrone.Aspire.Hosting.Temporal;

var builder = DistributedApplication.CreateBuilder(args);

var @namespace = "default";

// Add the Temporal resource with a PostgreSQL database.
// This will add a Docker container to the Aspire app, using the image 'byrone2/temporal'.
var temporal = builder.AddTemporalContainer(new TemporalContainerOptions
{
	Name = "Temporal",
	Namespaces = [@namespace],
	PostgresName = "TemporalPostgres",
	DatabaseName = "TemporalDatabase",
	DatabaseVolumeName = "temporal_postgres",
});

// (optional) Add the Temporal UI container resource.
var temporalUi = builder.AddTemporalUiContainer(temporal, new TemporalUiContainerOptions
{
	Name = "TemporalUi",
	Tag = "latest",
	DefaultNamespace = @namespace,
});

// Add your worker resource. This could be anything you'd like.
var worker = ;

// Adding a reference to the Temporal resource exposes a ConnectionString you can use.
worker.WithReference(temporal)
      .WaitFor(temporal);

var app = ;

app.WithReference(temporal)
   .WaitFor(temporal);