Skip to content

Expose Nextcloud Flow operations as graph nodes #32

Description

@rubenvdlinde

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:

  1. Lists registered IOperation implementations as palette entries, using their own display name, description and icon.
  2. Stores the chosen operation class plus its operation string in node config.
  3. 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions