WJb Docs - Reference

Browse APIs, configuration options, interfaces, and implementation details.

⚡ Actions
🔀 Workflow
📦 Jobs
⚙️ Runtime
💾 Persistence
🗄 Storage
🧩 Workflow Metadata
🛠 Extensions & Helpers

IActionFactory

Creates action instances for execution.

IActionFactory is responsible for resolving an action definition to an executable action instance.

Purpose

The WJb runtime executes actions by name.

Before an action can run, an implementation must be located and instantiated.

IActionFactory provides this resolution step.

Job
 ↓
Action Name
 ↓
IActionFactory
 ↓
IAction
 ↓
Execution

Responsibilities

Typical responsibilities include:

  • Resolving action types
  • Creating action instances
  • Integrating with dependency injection
  • Supporting custom action discovery mechanisms

Default Usage

Most applications do not interact with IActionFactory directly.

The runtime uses the factory internally whenever a job is executed.

Worker
 ↓
IActionFactory
 ↓
Action Instance
 ↓
Execute

Action Resolution

An action can be identified using its registered action name.

send-email
      ↓
IActionFactory
      ↓
SendEmailAction

The returned action instance is then executed by the runtime.

Dependency Injection

A factory implementation commonly integrates with the application's service provider.

This allows action constructors to receive dependencies such as:

  • Repositories
  • HTTP clients
  • Loggers
  • Application services

Custom Implementations

Advanced scenarios may require a custom factory.

Examples:

  • Plugin architectures
  • Dynamic action loading
  • External action registries
  • Specialized activation rules

Best Practices

Prefer Dependency Injection

Use dependency injection for action creation whenever possible.

Keep Resolution Predictable

Action names should resolve to a single action implementation.

Avoid Business Logic

The factory should only create actions.

Business rules belong inside actions.

Relationship to ActionNameAttribute

ActionNameAttribute provides the public identifier.

IActionFactory resolves that identifier to an executable action.

ActionNameAttribute
          ↓
     IActionFactory
          ↓
         IAction

Related Types

  • IAction
  • IAction
  • JobAction
  • ActionNameAttribute
  • JobInfo

See Also

  • ActionNameAttribute
  • IAction
  • JobAction
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.