Skip to content

Files

Latest commit

6123449 · May 16, 2025

History

History

activities-dependency-injection

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 12, 2022
Oct 18, 2021
Apr 20, 2022
Oct 18, 2021
Jul 6, 2022
Dec 3, 2024
Dec 3, 2024
Jan 24, 2023
Jan 24, 2023
Dec 9, 2024
May 16, 2025
Dec 13, 2024

README.md

Activities Dependency Injection

This sample shows how to share dependencies between Activities: for example, when you need to initialize a database connection once and then pass it to multiple Activities.

src/worker.ts

Running this sample

  1. temporal server start-dev to start Temporal Server.
  2. npm install to install dependencies (or pnpm or yarn).
  3. npm run start.watch to start the Worker.
  4. In another shell, npm run workflow to run the Workflow.

The Workflow should return:

Hello: Temporal
Hola: Temporal