Download the PHP package sofyco/workflow without Composer

On this page you can find all versions of the php package sofyco/workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package workflow

Sofyco Workflow

CI codecov Latest Stable Version License

A PHP library for building artifact-based workflow graphs — not linear prompt chains, but directed graphs where nodes consume and produce typed files.

Use it to orchestrate multimodal pipelines: LLM prompts, text-to-speech, image generation, video rendering, conditional branches, parallel fan-out/fan-in, and chained workflows.

Features

Requirements

No framework is required. Symfony Messenger and Doctrine adapters are provided as integration stubs.

Installation

Core concepts

Workflow graph

A workflow is a directed graph made of:

Concept Description
Workflow User-owned template (name, status, latest version)
WorkflowVersion Immutable published snapshot of the graph used at runtime
WorkflowNode A step in the graph (input, prompt, TTS, etc.)
WorkflowPort Typed input or output slot on a node
WorkflowEdge Connection from NodeA.outputPortNodeB.inputPort
WorkflowRun A single execution of a published version
NodeExecution One attempt to run a node within a run
Artifact A file produced or consumed during execution
ExecutionEvent Timeline entry for debugging and analytics

Artifacts

An artifact is always a physical file (or a reference to one in object storage). Format is determined by mimeType, not by a separate “text vs JSON” type.

Examples:

Content ArtifactType mimeType
Plain text File text/plain
JSON result File application/json
MP3 voiceover Audio audio/mpeg
PNG cover image Image image/png
MP4 video Video video/mp4

Rules:

  1. Nodes never return raw strings — they create artifacts.
  2. Artifacts are immutable once written.
  3. Retries create new NodeExecution records with a new attempt number.
  4. MongoDB (or any DB) stores metadata only; file content lives in object storage.

Node readiness

A node runs when:

  1. It is reachable from the start node.
  2. All required input ports have compatible artifacts.
  3. Incoming edge conditions are satisfied.
  4. It is not already running or completed.
  5. Retry limits have not been exceeded.

After one node finishes, the scheduler finds all ready nodes — not just the next one — enabling natural parallelism.

Architecture

Runtime services

Service Role
WorkflowRunService Starts a run, stores input artifacts, kicks the scheduler
WorkflowScheduler Finds all ready nodes and dispatches execution
WorkflowExecutionService Runs one node (idempotent via executionKey)
ArtifactResolver Maps edge outputs to node input ports
NodeReadinessResolver Checks required ports and artifact compatibility
ConditionEvaluator Evaluates edge conditions against runtime context
CompletionResolver Marks the run completed or failed
RuntimeContextBuilder Builds prompt/condition context from artifacts
ExecutionEventRecorder Writes timeline events

Node runners

NodeType Runner Status
input InputNodeRunner Implemented
prompt PromptNodeRunner Implemented
text_to_speech TextToSpeechNodeRunner Implemented
image_generation ImageGenerationNodeRunner Implemented
video_render VideoRenderNodeRunner Implemented
final_output FinalOutputNodeRunner Implemented
condition ConditionNodeRunner Stub
validator, transform, merge, … Planned

Register runners in NodeRunnerRegistry:

Quick start

The example below runs a workflow synchronously using in-memory repositories and local file storage. See tests/Support/WorkflowTestHarness.php for a complete wiring reference.

Input artifact format

When starting a run, pass input artifacts as an associative array:

Idempotency

Each node execution uses a unique key:

If Messenger redelivers a message, an already-completed execution is returned without re-running.

Building a workflow graph

Prompt templates

PromptRenderer replaces {{ dotted.path }} placeholders using the runtime context:

Template example:

Edge conditions

Conditions use a safe DSL — no user PHP:

Supported operators: equals, not_equals, greater_than, less_than, contains, exists.

Extending the library

LLM gateway

Used by PromptNodeRunner to generate text or JSON artifacts.

TTS gateway

Register providers in TtsGatewayRegistry. Example node settings for ElevenLabs:

Image generator

ImageGenerationNodeRunner can read a text prompt or extract a field from a JSON artifact:

Video renderer

VideoRenderNodeRunner expects audio and subtitles input ports and produces a video/mp4 artifact.

Artifact storage

LocalArtifactStorage is included for development. Implement S3ArtifactStorage for production object storage.

Recommended storage paths:

Async execution (Symfony Messenger)

For production, dispatch one message per node instead of calling process() synchronously:

The handler runs the node and calls WorkflowScheduler::scheduleReadyNodes() again.

Example workflows

The test suite includes three end-to-end workflow examples:

1. Video content production

Fixture: tests/Fixtures/VideoContentWorkflowFixture.php
Test: tests/Integration/VideoContentWorkflowTest.php

2. Website posts parsing

Fixture: tests/Fixtures/WebsitePostsParsingWorkflowFixture.php
Test: tests/Integration/WebsitePostsParsingWorkflowTest.php

3. Blog post generation (chained workflow)

Takes a post from the parsing workflow and generates a full site post in parallel:

Fixture: tests/Fixtures/BlogPostGenerationWorkflowFixture.php
Test: tests/Integration/BlogPostGenerationWorkflowTest.php

The blog post test demonstrates workflow chaining: it runs the parsing workflow first, extracts the first post artifact, and feeds it into the generation workflow.

Symfony integration (optional)

The library ships stubs for Symfony Messenger and Doctrine repositories:

Component Namespace
Repositories Sofyco\Workflow\Infrastructure\Doctrine\*Repository
Messenger Sofyco\Workflow\Infrastructure\Messenger\ExecuteWorkflowNode

Wire these in your Symfony app via service configuration. The core engine has no Symfony dependency. HTTP endpoints for a workflow builder UI belong in your application layer, not in this library.

Development

Clone the repository and run tests with Docker:

Or without Docker:

Project structure (tests)

Design principles

  1. Nodes produce artifacts, not strings.
  2. Text and JSON are File artifacts with the appropriate MIME type.
  3. WorkflowVersion is immutable — runs always execute against the version they started with.
  4. Parallelism is native — the scheduler runs every ready node, not just one.
  5. Retries are new attempts — history is preserved for auditing and debugging.
  6. Conditions are safe — limited DSL, no eval or user code.
  7. Loops must be bounded — configure maxTotalNodeExecutions and maxAttemptsPerNode on the workflow version.

Roadmap

License

This package is open-source software licensed under the MIT license.

Author

Sofiia Korzhova — [email protected]


All versions of workflow with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sofyco/workflow contains the following files

Loading the files please wait ...