1.6.5 • Published 3 months ago

chrono-forge v1.6.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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

3 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

4 months ago

1.5.9

4 months ago

1.5.8

4 months ago

1.5.7

4 months ago

1.5.6

4 months ago

1.5.10

4 months ago

1.5.12

4 months ago

1.5.11

4 months ago

1.5.14

4 months ago

1.5.13

4 months ago

1.4.23

4 months ago

1.5.4

4 months ago

1.5.3

4 months ago

1.5.2

4 months ago

1.5.1

4 months ago

1.5.0

4 months ago

1.4.20

4 months ago

1.4.22

4 months ago

1.4.21

4 months ago

1.4.13

4 months ago

1.4.15

4 months ago

1.4.14

4 months ago

1.4.17

4 months ago

1.4.16

4 months ago

1.4.18

4 months ago

1.3.53

5 months ago

1.3.51

5 months ago

1.3.52

5 months ago

1.4.11

4 months ago

1.4.10

4 months ago

1.4.12

4 months ago

1.4.6

4 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

4 months ago

1.4.8

4 months ago

1.4.7

4 months ago

1.3.50

5 months ago

1.3.47

5 months ago

1.3.49

5 months ago

1.3.46

7 months ago

1.3.45

7 months ago

1.3.39

8 months ago

1.3.38

8 months ago

1.3.42

8 months ago

1.3.43

8 months ago

1.3.40

8 months ago

1.3.41

8 months ago

1.3.44

8 months ago

1.3.35

8 months ago

1.3.36

8 months ago

1.3.37

8 months ago

1.3.31

8 months ago

1.3.32

8 months ago

1.3.30

8 months ago

1.3.33

8 months ago

1.3.34

8 months ago

1.3.17

8 months ago

1.3.18

8 months ago

1.3.15

8 months ago

1.3.16

8 months ago

1.3.19

8 months ago

1.3.20

8 months ago

1.3.21

8 months ago

1.3.24

8 months ago

1.3.25

8 months ago

1.3.22

8 months ago

1.3.23

8 months ago

1.3.28

8 months ago

1.3.29

8 months ago

1.3.26

8 months ago

1.3.27

8 months ago

1.3.9

8 months ago

1.3.8

8 months ago

1.3.10

8 months ago

1.3.13

8 months ago

1.3.14

8 months ago

1.3.11

8 months ago

1.3.12

8 months ago

1.3.7

8 months ago

1.3.6

8 months ago

1.3.5

8 months ago

1.3.4

8 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.2.12

8 months ago

1.2.10

8 months ago

1.2.11

8 months ago

1.2.9

8 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.2.0

8 months ago

1.2.8

8 months ago

1.2.7

8 months ago

1.2.6

8 months ago

1.2.5

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.1.1

9 months ago

0.9.34

9 months ago

1.1.0

9 months ago

0.9.35

9 months ago

0.9.36

9 months ago

0.9.37

9 months ago

0.9.30

9 months ago

0.9.31

9 months ago

0.9.32

9 months ago

0.9.33

9 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

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.12

8 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.14

8 months ago

1.1.13

8 months ago

0.9.23

9 months ago

0.9.24

9 months ago

0.9.25

9 months ago

0.9.26

9 months ago

0.9.22

9 months ago

0.9.27

9 months ago

0.9.28

9 months ago

0.9.29

9 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

9 months ago

0.8.8

9 months ago

0.8.5

9 months ago

0.4.9

10 months ago

0.8.4

9 months ago

0.4.8

10 months ago

0.8.7

9 months ago

0.8.6

9 months ago

0.7.22

9 months ago

0.7.21

9 months ago

0.7.24

9 months ago

0.7.23

9 months ago

0.7.20

9 months ago

0.7.26

9 months ago

0.7.25

9 months ago

0.7.27

9 months ago

0.3.0

10 months ago

0.7.2

9 months ago

0.3.5

10 months ago

0.7.4

9 months ago

0.7.3

9 months ago

0.3.7

10 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.7.0

9 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.9.8

9 months ago

0.7.11

9 months ago

0.9.7

9 months ago

0.7.10

9 months ago

0.7.13

9 months ago

0.9.9

9 months ago

0.7.12

9 months ago

0.9.4

9 months ago

0.5.8

9 months ago

0.9.3

9 months ago

0.5.7

9 months ago

0.9.6

9 months ago

0.9.5

9 months ago

0.7.19

9 months ago

0.7.18

9 months ago

0.7.15

9 months ago

0.7.14

9 months ago

0.7.17

9 months ago

0.7.16

9 months ago

0.9.20

9 months ago

0.9.21

9 months ago

0.8.1

9 months ago

0.4.5

10 months ago

0.8.0

9 months ago

0.4.4

10 months ago

0.8.3

9 months ago

0.4.7

10 months ago

0.8.2

9 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

9 months ago

0.9.13

9 months ago

0.9.14

9 months ago

0.9.15

9 months ago

0.6.7

9 months ago

0.6.6

9 months ago

0.9.10

9 months ago

0.6.9

9 months ago

0.9.11

9 months ago

0.6.8

9 months ago

0.9.16

9 months ago

0.9.17

9 months ago

0.9.18

9 months ago

0.9.19

9 months ago

0.6.10

9 months ago

0.9.0

9 months ago

0.5.4

10 months ago

0.5.3

10 months ago

0.9.2

9 months ago

0.5.6

9 months ago

0.9.1

9 months ago

0.5.5

9 months ago

0.5.0

10 months ago

0.5.2

10 months ago

0.1.6

10 months ago

0.5.1

10 months ago

0.1.5

10 months ago

0.8.23

9 months ago

0.8.22

9 months ago

0.7.9

9 months ago

0.7.6

9 months ago

0.7.5

9 months ago

0.8.21

9 months ago

0.7.8

9 months ago

0.8.20

9 months ago

0.7.7

9 months ago

0.8.12

9 months ago

0.8.11

9 months ago

0.8.14

9 months ago

0.8.13

9 months ago

0.8.10

9 months ago

0.8.19

9 months ago

0.8.16

9 months ago

0.8.15

9 months ago

0.8.18

9 months ago

0.8.17

9 months ago

0.2.1

10 months ago

0.6.3

9 months ago

0.6.5

9 months ago

0.6.4

9 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.6.1

9 months ago

0.2.5

10 months ago

0.6.0

9 months ago

0.2.4

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.1

10 months ago