Skip to content

Inject automation: inject-message automation and runtime endpoint #437

Closed

Description

@Steve-Mcl

Description

(prototype done; remaining work is review, polish and the release)

Add the editor automation automation/inject-message ({ id, msg? }) and the runtime route POST /nr-assistant/inject. Together they inject a message into a deployed node.

  • Editor checks: refuse unknown nodes, nodes with no input port, disabled nodes or tabs, nodes inside a subflow definition, and nodes with undeployed changes. Return success: false with a reason.
  • Runtime:
    • Requires write permission.
    • Re-checks AI Flow Deploy on every call through the shared getAutoDeployPolicy(), which fails closed.
    • Looks up the node with RED.nodes.getNode, replaces _msgid, calls node.receive(), and returns { injected, msgid }.
  • Refusal code: INJECT_NOT_ALLOWED when the policy is off.
  • Audit: RED.log.audit({ event: 'nr-assistant.inject', node, type, name, z }, req). Add name and z to the current prototype so forge can show details.
  • Tests: unit tests for the editor action and the route.

Acceptance criteria:

  • Injecting into a deployed function node shows up in the downstream debug with the returned msgid.
  • With AI Flow Deploy off, the route returns injected: false, code: INJECT_NOT_ALLOWED, and nothing is delivered.

Epic/Story

No response

Metadata

Metadata

Assignees

Labels

area:ff-expertFlowFuse AI AssistanttaskA piece of work that isn't necessarily tied to a specific Epic or Story.time:3h

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions