Nextcloud ships its own workflow engine (workflowengine), and its operations should be usable as nodes on a hermiq graph instead of being a parallel, disconnected automation system.
What core exposes
OCP\WorkflowEngine\IManager is the registration point:
registerEntity(IEntity) — what a rule reacts to (files, etc.)
registerOperation(IOperation) — what a rule does
registerCheck(ICheck) — the conditions
getRuleMatcher(): IRuleMatcher
IOperation is a small contract — getDisplayName(), getDescription(), getIcon(), isAvailableForScope(int), validateOperation(name, checks, operation), onEvent(eventName, Event, IRuleMatcher). There are also IComplexOperation and ISpecificOperation variants, and IEntityCheck / IFileCheck on the check side.
Every app that registers an operation (tagging, file conversion, script execution, webhook notifications, …) therefore already advertises a display name, description, and icon — enough to populate a node palette without hard-coding a list.
Proposal
A flow-operation node type that:
- Lists registered
IOperation implementations as palette entries, using their own display name, description and icon.
- Stores the chosen operation class plus its operation string in node config.
- Invokes it during the graph walk with the run state as context.
Open questions
IOperation::onEvent() is event-shaped, not call-shaped — it expects an Event and an IRuleMatcher. Driving one from a graph hop needs either a synthetic event + matcher, or a narrower adapter for the operations that can be invoked directly. This is the main design question and should be settled before any code.
- Core Flow operations are largely file-scoped (
IFileCheck, file entities), while a hermiq graph walks an OpenRegister object. The mapping between the two is not automatic, and some operations may simply not be applicable.
- Scope:
isAvailableForScope() distinguishes admin vs per-user rules; a graph node has to respect that rather than run everything as admin.
Raised from the graph builder work (#30).
Nextcloud ships its own workflow engine (
workflowengine), and its operations should be usable as nodes on a hermiq graph instead of being a parallel, disconnected automation system.What core exposes
OCP\WorkflowEngine\IManageris the registration point:registerEntity(IEntity)— what a rule reacts to (files, etc.)registerOperation(IOperation)— what a rule doesregisterCheck(ICheck)— the conditionsgetRuleMatcher(): IRuleMatcherIOperationis a small contract —getDisplayName(),getDescription(),getIcon(),isAvailableForScope(int),validateOperation(name, checks, operation),onEvent(eventName, Event, IRuleMatcher). There are alsoIComplexOperationandISpecificOperationvariants, andIEntityCheck/IFileCheckon the check side.Every app that registers an operation (tagging, file conversion, script execution, webhook notifications, …) therefore already advertises a display name, description, and icon — enough to populate a node palette without hard-coding a list.
Proposal
A
flow-operationnode type that:IOperationimplementations as palette entries, using their own display name, description and icon.Open questions
IOperation::onEvent()is event-shaped, not call-shaped — it expects anEventand anIRuleMatcher. Driving one from a graph hop needs either a synthetic event + matcher, or a narrower adapter for the operations that can be invoked directly. This is the main design question and should be settled before any code.IFileCheck, file entities), while a hermiq graph walks an OpenRegister object. The mapping between the two is not automatic, and some operations may simply not be applicable.isAvailableForScope()distinguishes admin vs per-user rules; a graph node has to respect that rather than run everything as admin.Raised from the graph builder work (#30).