πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

chrono-forge

Package Overview
Dependencies
Maintainers
1
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrono-forge

A comprehensive framework for building resilient Temporal workflows, advanced state management, and real-time streaming activities in TypeScript. Designed for a seamless developer experience with powerful abstractions, dynamic orchestration, and full cont

1.9.0
latest
Source
npm
Version published
Weekly downloads
185
-58.52%
Maintainers
1
Weekly downloads
Β 
Created
Source

Temporal-Forge

(A Next-Gen Temporal Workflow Orchestration Framework for TypeScript)

Sponsor on GitHub Test Suite Quality Gate Status Reliability Rating Security Rating Maintainability Rating

Temporal-Forge supercharges Temporal.io workflows by eliminating boilerplate, automating state management, and enabling seamless hierarchical orchestration.

  • Decorator-Based API β†’ Write workflows in a declarative, intuitive way
  • Event-Driven Updates β†’ No pollingβ€”Workflows automatically synchronize state
  • State Normalization & Hierarchical Management β†’ Built-in entity normalization & child workflow orchestration
  • ContinueAsNew & Long-Running Workflow Support β†’ Efficiently persists state and prevents history bloat
  • API Integration β†’ Load & sync external data in real-time
  • Built-in Observability β†’ OpenTelemetry support for tracing and debugging

πŸ’‘ Why Use Temporal-Forge?

  • πŸš€ Faster Workflow Development β†’ No need to manually manage signals, queries, or updates.
  • 🧠 Intelligent State Management β†’ Normalized entities with automatic denormalization and caching.
  • 🎯 Precision Updates β†’ Changes only propagate where needed, eliminating redundant state syncing.
  • πŸ€– Automatic Child Workflow Handling β†’ Start, stop, and update workflows without writing extra logic.

πŸ“Œ Key Features

1️⃣ Step-Based Workflow Execution

Temporal-Forge simplifies workflow design using decorators like @Step(), @Query(), and @Signal() to define workflow logic.

  • Step-based execution with dependencies
  • Conditional branching & dynamic workflow control
  • Lifecycle hooks (@Before(), @After(), @Hook())

2️⃣ Advanced Stateful Workflow Management

Stateful workflows handle complex entity relationships with automatic state tracking.
βœ” Automatic child workflow execution & cancellation
βœ” Parent workflows automatically sync child state changes
βœ” Limitless nesting of parent-child workflows

3️⃣ Event-Driven, Subscription-Based Updates (No Polling)

  • Entities update automatically across workflows
  • Only relevant workflows receive updates via event-driven signals
  • Ancestor tracking prevents infinite loops & redundant updates

πŸ’‘ How it Works? β†’ Each workflow subscribes to only the data it cares about.
If an entity updates, only dependent workflows receive updates, ensuring low-latency state propagation.

4️⃣ Normalized State & Cached Denormalization

State is structured using normalizr, ensuring efficient, normalized entity management.
βœ” Automatically flattens nested relationships
βœ” StateManager & limitRecursion cache queries to optimize lookups
βœ” Denormalization is fully cached & optimized

5️⃣ Auto-Managed Child Workflow Lifecycle

  • βœ… Starts child workflows when needed
  • βœ… Cancels workflows when dependencies change
  • βœ… Passes subscription objects so child workflows notify parents of updates

No more manual child workflow managementβ€”it just works.

πŸ“¦ Installation

npm install temporal-forge

or

yarn add temporal-forge

πŸ”§ Requirements:

  • Node.js 20+
  • Temporal.io’s TypeScript SDK 1.11.7+

πŸš€ Quick Start

Basic Workflow

import { Temporal, Workflow } from 'temporal-forge';

@Temporal()
class SimpleWorkflow extends Workflow {
  async execute() {
    this.log.info('Executing workflow...');
  }
}

export default SimpleWorkflow;

Stateful Workflow Example

// Your types
type User = {
  id: string;
  likes: Like[];
};

type Like = {
  id: string;
  user: User;
};
import { Temporal, StatefulWorkflow, SchemaManagerStatefulWorkflowParams, StatefulWorkflowOptions } from 'temporal-forge';

@Temporal({
  schemaName: "User",
  schemas: SchemaManager.schemas
})
class UserWorkflow extends StatefulWorkflow<
  StatefulWorkflowParams<User>,
  StatefulWorkflowOptions
> {
  @Property({ path: 'likes' })
  protected likes!: Like[];

  async execute() {
    this.log.info('Executing workflow, all children in this.likes will have been auto started...');
  }
}

export default UserWorkflow;
// Set your schemas (usually done in src/schemas.ts)
SchemaManager.parseYAML(`
  User:
    idAttribute: id
    likes: [Like]
  Like:
    idAttribute: id
    user: User
`);

πŸ’‘ This workflow automatically normalizes state and updates subscribers whenever data is changed!

πŸ“– Documentation

πŸ“š Read the full docs:

πŸ› οΈ Core Concepts

βœ” Step-Based Execution β†’ Define steps using @Step()
βœ” Workflow Lifecycle Management β†’ Manage workflow execution state
βœ” Query & Signal Handling β†’ Real-time data retrieval and updates
βœ” Automatic Retry & Error Handling β†’ Decorators like @OnError() simplify failure recovery

πŸ“Œ Advanced Topics

  • Handling Circular Workflow Relationships β†’ Prevents redundant updates
  • Security & API Token Management β†’ Securely handle external API access
  • ContinueAsNew Optimization β†’ Ensures long-running workflows stay within Temporal’s execution limits

πŸ” Full API reference available in docs/API.md

πŸ§ͺ Testing & Validation

Temporal-Forge includes a comprehensive test suite:

  • βœ… Unit tests for decorators, subscriptions, and state management
  • βœ… Integration tests covering real-world workflow scenarios
  • βœ… SonarCloud reports for maintainability, security, and reliability

πŸ’‘ Run tests locally:

npm run test

🀝 Contributing

πŸš€ We welcome contributions! Whether it's bug fixes, feature requests, or documentation improvementsβ€”join the project and help make Temporal-Forge even better.

πŸ“Œ See CONTRIBUTING.md for details.

πŸ“œ License

MIT License – See the LICENSE file for more details.

πŸ’‘ "Those who say it cannot be done should stop interrupting the people doing it."

Keywords

temporal

FAQs

Package last updated on 02 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts