Skip to content

feat: asynchronous process start for routed events (0.4.0) - #8

Merged
schmunk42 merged 9 commits into
masterfrom
feature/process-start
Dec 6, 2026
Merged

schmunk42 merged 9 commits into
masterfrom
feature/process-start

Conversation

@schmunk42

@schmunk42 schmunk42 commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Release candidate for 0.4.0, based on 0.3.0.

  • Process start: the intake dispatches one StartProcess message (event id only) after an event became routed; a handler on the Messenger transport webhook claims the event, checks the engine for an instance with the business key and the endpoint variable, starts the route's process definition otherwise and records started with the instance id. A failure carries only a reason category; after the last retry the event is failed with it.
  • Engine port: ProcessEngineInterface with a Flowable implementation over dmstr/flowable-bundle (loaded only when FlowableBundle is registered) and MissingProcessEngine.
  • Answer process: config/bpmn/webhook-answer.bpmn20.xml, AnswerProcess constants, command webhook:process:deploy (uploads nothing when the deployed content is unchanged).
  • Catch-up: ProcessStartCatchUp and webhook:process:catch-up for routed events without instance between catch_up.min_age and catch_up.max_age.
  • Schema: migration Version20261205225504 adds start_claimed_at and the reference columns to webhook_event (Schema API, MySQL and PostgreSQL).
  • Requirements: dmstr/flowable-bundle >=0.12.1 <0.15 and symfony/messenger ^7.4 are hard requirements now.
  • Refactoring first: the origin status of EventStore::transition() as a parameter, in its own commit.

The workflow runs MySQL 8 and PostgreSQL against flowable-bundle 0.12.1 and 0.14.0. See the upgrade notes in CHANGELOG.md; its heading still reads Unreleased and gets the date with the tag.

Merge and tag only after the maintainer's approval.

🤖 Generated with Claude Code

…rameter [*]

EventStore::transition() takes the origin status as its last argument,
"received" by default, and rejects a terminal origin and a move to the
origin itself. EventStatusTransition keeps its meaning: only from
"received". Prepares the asynchronous process start, which leaves
"routed".

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@schmunk42 schmunk42 self-assigned this Dec 5, 2026
schmunk42 and others added 7 commits December 5, 2026 23:00
…aim column [*]

webhook_event gets start_claimed_at (the lease of a start attempt) and
kind and id of the project, target, note and discussion reference,
written with the row at insert and readable on the admin resource.
New migration Version20261205225504 (Schema API, MySQL and PostgreSQL).
No note text and no payload goes into the columns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ProcessEngineInterface (deploy, start with business key, find instances
with variables) is the only way the bundle talks to a process engine.
FlowableProcessEngine implements it over dmstr/flowable-bundle and loads
only when FlowableBundle is registered; otherwise MissingProcessEngine
answers every call with engine_port_missing. A failure is a
ProcessEngineException with a reason category and never the engine's
text. New hard requirements: dmstr/flowable-bundle >=0.12.1 <0.15 and
symfony/messenger ^7.4.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On an uncompiled container a class excluded by file still has an
abstract definition tagged container.excluded, so hasDefinition() is
true. The registration test accepts that marker and checks both engine
implementations symmetrically.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…cess:deploy [*]

config/bpmn/webhook-answer.bpmn20.xml defines the process webhookAnswer:
an external-worker task on the topic webhook-answer, an error boundary
event and an external-worker task on webhook-error-answer. AnswerProcess
holds key, resource name, topics and error code. The command deploys the
definition to the Flowable connections of the process endpoints and
uploads nothing when the deployed content is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nsport webhook [*]

The intake dispatches one StartProcess message (event id only) after an
event became routed and makes no engine call in the request. The handler
claims the event (start_claimed_at, one conditional update), looks for
an instance with the business key and the endpoint variable, starts the
route's process definition otherwise and records started with the
instance id. A failure carries only a reason category; after the last
retry a listener sets the event to failed with it. The bundle prepends
the routing of the message and, unless the application defines it, the
transport webhook (in-memory, never sync). A start rejected with 422 is
definition_not_deployed when the engine has no definition of the key.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ProcessStartCatchUp starts routed events without instance that were
received between catch_up.min_age (300 s) and catch_up.max_age (86400 s)
and whose claim is empty or expired, directly through the starter and
not through the transport. An unrecoverable failure sets the event to
failed, a retryable one leaves it routed for the next run. The command
webhook:process:catch-up wraps it, with a limit and a dry run. The
bundle ships no schedule; the application calls the service.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…, workflow against both flowable-bundle bounds [*]

README, CLAUDE.md and the changelog describe the asynchronous process
start, the transport webhook an application has to define, the reason
categories, the engine port, the answer process, both commands and the
upgrade from 0.3.x with the check query for routed events. The workflow
runs four jobs: MySQL and PostgreSQL against dmstr/flowable-bundle
0.12.1 and 0.14.0, with an assertion of the installed version. The
suggestions for symfony/http-client and symfony/security-bundle go,
both come with dmstr/flowable-bundle now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@schmunk42
schmunk42 marked this pull request as ready for review December 6, 2026 00:32
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@schmunk42
schmunk42 merged commit aa61987 into master Dec 6, 2026
8 checks passed
@schmunk42
schmunk42 deleted the feature/process-start branch December 6, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant