Skip to content

Latest commit

 

History

History
59 lines (52 loc) · 1.76 KB

File metadata and controls

59 lines (52 loc) · 1.76 KB

dotnet-workflow-interceptor

Demonstrates how to use a workflow interceptor to call an activity once the workflow is complete.

The worker is located in the worker folder and the client application is located in the client folder.

Run Worker Locally

cd worker
dotnet run

Start Workflow Locally using Temporal CLI

# run only once
temporal server start-dev
# trigger a workflow locally
temporal workflow start --type SimpleWorkflow --task-queue simple-workflow-interceptor --input '{"val":"foo"}'

Start the Workflow using the Client application

cd client
dotnet run

Run Worker using Temporal Cloud

# set up environment variables
export TEMPORAL_NAMESPACE=<namespace>.<accountId>
export TEMPORAL_ADDRESS=<namespace>.<accountId>.tmprl.cloud:7233
export TEMPORAL_TLS_CERT=/path/to/cert
export TEMPORAL_TLS_KEY=/path/to/key
# run the worker
# if not in worker folder, change directories
cd worker
dotnet run

Start Workflow on Temporal Cloud

# set your temporal environment
temporal env set dev.namespace <namespace>.<accountId>
temporal env set dev.address <namespace>.<accountId>.tmprl.cloud:7233
temporal env set dev.tls-cert-path /path/to/cert
temporal env set dev.tls-key-path /path/to/key 
# trigger a workflow on Temporal Cloud
temporal workflow start --type SimpleWorkflow --task-queue simple-workflow-interceptor --input '{"val":"foo"}' --env dev

Start the Workflow on Temporal Cloud using the client app

# set your temporal environment
temporal env set dev.namespace <namespace>.<accountId>
temporal env set dev.address <namespace>.<accountId>.tmprl.cloud:7233
temporal env set dev.tls-cert-path /path/to/cert
temporal env set dev.tls-key-path /path/to/key 
cd client
dotnet run