workflow_update
Add, remove, or edit nodes, edges, and mitigation selections in an existing SOLVE-IT workflow, then save the updated JSON file or share link.
Instructions
Change an existing SOLVE-IT workflow and write the result.
The source is a workflow .json file in an allowed directory (see workflow_status), or a Workflow Builder share link (https://workflows.hargs.co.uk/#~...). If the user has opened or edited the workflow in the builder since it was written, ask them for a fresh export or a share link from the builder's Share button and use that as source, so their edits are not lost.
Operations: add nodes and edges, remove nodes or edges by ID (a removed node's edges, selections, evaluations and provenance go with it, and are reported), set data fields on a node, and set mitigation selections. Existing nodes keep their IDs, positions and data except for fields you set; everything else in the file is kept. New nodes are placed after their predecessors. Nodes are given with your own keys; edges, selections and zone members refer to those keys, and the result maps each key to the node ID the server assigned. A sub-technique ID can be given directly as a technique: it is stored as its parent technique with the sub-technique as a method. Zones take the keys of their member nodes and are drawn around them. Use decision or fork nodes for branches out of a step. Use workflow_find_techniques to look up DFT IDs. New edges, selections and set_data may also refer to existing node IDs; call workflow_inspect first to get node IDs when the workflow came from the builder or an earlier session. Edges cannot connect notes or zones: the builder draws no connection points on them.
Where it is written: a source file inside the output directory is updated in place; a source elsewhere, or a link, gives a new file in the output directory (named by 'filename', else the source file's name, else the title). The result gives the path written, which later updates should use.
If a link is returned, give it to the user exactly as returned, in full: changing even one character breaks it. The file path, or open_in_browser=true, is the dependable way to open the workflow; offer those, especially when there is no link (large workflows exceed the 8000-character link limit).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Path to a workflow .json file in an allowed directory, or a Workflow Builder share link https://workflows.hargs.co.uk/#~... | |
| filename | No | File name in the output directory for the result. Leave out to update a file in the output directory in place. | |
| relayout | No | Lay the whole workflow out again instead of only placing new nodes. Use it when adding a zone round existing nodes that are not next to each other, or after large changes. It moves every node, so arrangements made by hand in the builder are lost. Existing zones keep the nodes that lie inside them. | |
| set_data | No | Data fields to set on existing or added nodes. | |
| add_edges | No | Connections to add, between new node keys or existing node IDs. | |
| add_nodes | No | Nodes to add, each with your own key. | |
| direction | No | Direction for placing new nodes. Leave out to keep the workflow's own direction. | |
| overwrite | No | Replace an existing file of the chosen name even if this server did not write it. Otherwise a numbered name is used. | |
| remove_ids | No | IDs of existing nodes or edges to remove. | |
| selections | No | Mitigation selections to set (Y, N or NA) per step and weakness. | |
| open_in_browser | No | Also open the workflow in the default browser on this machine. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||