1.6.5 • Published 4 months ago

chrono-forge v1.6.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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 UpdatesNo polling—Workflows automatically synchronize state
  • State Normalization & Hierarchical Management → Built-in entity normalization & child workflow orchestration
  • ContinueAsNew & Long-Running Workflow SupportEfficiently 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."

1.6.4

4 months ago

1.6.5

4 months ago

1.6.3

4 months ago

1.6.2

4 months ago

1.6.1

4 months ago

1.6.0

4 months ago

1.5.16

4 months ago

1.5.15

4 months ago

1.5.18

4 months ago

1.5.17

4 months ago

1.5.19

4 months ago

1.5.5

5 months ago

1.5.9

5 months ago

1.5.8

5 months ago

1.5.7

5 months ago

1.5.6

5 months ago

1.5.10

5 months ago

1.5.12

4 months ago

1.5.11

5 months ago

1.5.14

4 months ago

1.5.13

4 months ago

1.4.23

5 months ago

1.5.4

5 months ago

1.5.3

5 months ago

1.5.2

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.20

5 months ago

1.4.22

5 months ago

1.4.21

5 months ago

1.4.13

5 months ago

1.4.15

5 months ago

1.4.14

5 months ago

1.4.17

5 months ago

1.4.16

5 months ago

1.4.18

5 months ago

1.3.53

5 months ago

1.3.51

5 months ago

1.3.52

5 months ago

1.4.11

5 months ago

1.4.10

5 months ago

1.4.12

5 months ago

1.4.6

5 months ago

1.4.5

5 months ago

1.4.4

5 months ago

1.4.3

5 months ago

1.4.2

5 months ago

1.4.1

5 months ago

1.4.0

5 months ago

1.4.9

5 months ago

1.4.8

5 months ago

1.4.7

5 months ago

1.3.50

6 months ago

1.3.47

6 months ago

1.3.49

6 months ago

1.3.46

8 months ago

1.3.45

8 months ago

1.3.39

9 months ago

1.3.38

9 months ago

1.3.42

9 months ago

1.3.43

9 months ago

1.3.40

9 months ago

1.3.41

9 months ago

1.3.44

9 months ago

1.3.35

9 months ago

1.3.36

9 months ago

1.3.37

9 months ago

1.3.31

9 months ago

1.3.32

9 months ago

1.3.30

9 months ago

1.3.33

9 months ago

1.3.34

9 months ago

1.3.17

9 months ago

1.3.18

9 months ago

1.3.15

9 months ago

1.3.16

9 months ago

1.3.19

9 months ago

1.3.20

9 months ago

1.3.21

9 months ago

1.3.24

9 months ago

1.3.25

9 months ago

1.3.22

9 months ago

1.3.23

9 months ago

1.3.28

9 months ago

1.3.29

9 months ago

1.3.26

9 months ago

1.3.27

9 months ago

1.3.9

9 months ago

1.3.8

9 months ago

1.3.10

9 months ago

1.3.13

9 months ago

1.3.14

9 months ago

1.3.11

9 months ago

1.3.12

9 months ago

1.3.7

9 months ago

1.3.6

9 months ago

1.3.5

9 months ago

1.3.4

9 months ago

1.3.3

9 months ago

1.3.2

9 months ago

1.2.12

9 months ago

1.2.10

9 months ago

1.2.11

9 months ago

1.2.9

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.0

9 months ago

1.2.8

9 months ago

1.2.7

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.1.1

9 months ago

0.9.34

10 months ago

1.1.0

9 months ago

0.9.35

10 months ago

0.9.36

10 months ago

0.9.37

10 months ago

0.9.30

10 months ago

0.9.31

10 months ago

0.9.32

10 months ago

0.9.33

10 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

0.9.38

10 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.14

9 months ago

1.1.13

9 months ago

0.9.23

10 months ago

0.9.24

10 months ago

0.9.25

10 months ago

0.9.26

10 months ago

0.9.22

10 months ago

0.9.27

10 months ago

0.9.28

10 months ago

0.9.29

10 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

1.0.3

9 months ago

0.8.9

10 months ago

0.8.8

10 months ago

0.8.5

10 months ago

0.4.9

10 months ago

0.8.4

10 months ago

0.4.8

10 months ago

0.8.7

10 months ago

0.8.6

10 months ago

0.7.22

10 months ago

0.7.21

10 months ago

0.7.24

10 months ago

0.7.23

10 months ago

0.7.20

10 months ago

0.7.26

10 months ago

0.7.25

10 months ago

0.7.27

10 months ago

0.3.0

10 months ago

0.7.2

10 months ago

0.3.5

10 months ago

0.7.4

10 months ago

0.7.3

10 months ago

0.3.7

10 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.7.0

10 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.9.8

10 months ago

0.7.11

10 months ago

0.9.7

10 months ago

0.7.10

10 months ago

0.7.13

10 months ago

0.9.9

10 months ago

0.7.12

10 months ago

0.9.4

10 months ago

0.5.8

10 months ago

0.9.3

10 months ago

0.5.7

10 months ago

0.9.6

10 months ago

0.9.5

10 months ago

0.7.19

10 months ago

0.7.18

10 months ago

0.7.15

10 months ago

0.7.14

10 months ago

0.7.17

10 months ago

0.7.16

10 months ago

0.9.20

10 months ago

0.9.21

10 months ago

0.8.1

10 months ago

0.4.5

10 months ago

0.8.0

10 months ago

0.4.4

10 months ago

0.8.3

10 months ago

0.4.7

10 months ago

0.8.2

10 months ago

0.4.6

10 months ago

0.4.1

10 months ago

0.4.0

10 months ago

0.4.3

10 months ago

0.4.2

10 months ago

0.9.12

10 months ago

0.9.13

10 months ago

0.9.14

10 months ago

0.9.15

10 months ago

0.6.7

10 months ago

0.6.6

10 months ago

0.9.10

10 months ago

0.6.9

10 months ago

0.9.11

10 months ago

0.6.8

10 months ago

0.9.16

10 months ago

0.9.17

10 months ago

0.9.18

10 months ago

0.9.19

10 months ago

0.6.10

10 months ago

0.9.0

10 months ago

0.5.4

10 months ago

0.5.3

10 months ago

0.9.2

10 months ago

0.5.6

10 months ago

0.9.1

10 months ago

0.5.5

10 months ago

0.5.0

10 months ago

0.5.2

10 months ago

0.1.6

11 months ago

0.5.1

10 months ago

0.1.5

11 months ago

0.8.23

10 months ago

0.8.22

10 months ago

0.7.9

10 months ago

0.7.6

10 months ago

0.7.5

10 months ago

0.8.21

10 months ago

0.7.8

10 months ago

0.8.20

10 months ago

0.7.7

10 months ago

0.8.12

10 months ago

0.8.11

10 months ago

0.8.14

10 months ago

0.8.13

10 months ago

0.8.10

10 months ago

0.8.19

10 months ago

0.8.16

10 months ago

0.8.15

10 months ago

0.8.18

10 months ago

0.8.17

10 months ago

0.2.1

11 months ago

0.6.3

10 months ago

0.6.5

10 months ago

0.6.4

10 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.6.1

10 months ago

0.2.5

11 months ago

0.6.0

10 months ago

0.2.4

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.0.1

11 months ago