Skip to content

Commit

Permalink
Update flow debug context descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-wisely-gravwell committed May 2, 2024
1 parent aa76fb6 commit d57679e
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 13 deletions.
3 changes: 2 additions & 1 deletion alerts/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@ If we were to add another field, "foobar", which is *not* output by the dispatch

Schemas are entirely optional, but highly recommended. They make it easier to define dispatchers and to test/debug consumers.

(define-a-consumer)=
## Defining a Consumer

Currently, [flows](/flows/flows) are the only type of consumer supported for alerts. When a flow executes as a consumer, the incoming payload contains an additional item named `event` which contains the event sent by the dispatcher.

### Building a Consumer Flow

We can test our flow in development as though it were triggered by an alert by selecting the alert from the Alert Context dropdown:
We can test our flow in development as though it were triggered by an alert by selecting the alert from the Alert Context dropdown. Alerts that are already connected to this flow are listed as **Linked Alerts**, and alerts that are _not_ connected to this flow are listed as **Other Alerts**:

![](flow-context-menu.png)

Expand Down
Binary file modified alerts/flow-context-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flows/debug-if-false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flows/debug-if-payload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flows/debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 27 additions & 12 deletions flows/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ Nodes are instantiated by dragging them from the palette onto the canvas. Once o

The toolbar contains buttons for quick access to editor functionality. From left to right:

* Flow Designer: shows the flow canvas (default view).
* Info & Scheduling: shows options to set flow name, description, scheduling, sharing, etc.
* Enable scheduling: toggle to quickly enable/disable automatic execution of the flow.
* Save: save the flow.
* Debug: run the flow
* Clear selection: deselects any currently-selected node.
* Delete: delete the selected node.
* Delete all: delete all nodes (requires confirmation).
* Export flow: download the flow specification, for backup or sharing.
* Import flow: upload a previously-exported flow spec.
* Fit all nodes on screen: zoom & center the canvas so that *all* nodes are visible.
* Fullscreen: puts the editor into fullscreen mode.
* **Flow Designer**: shows the flow canvas (default view).
* **Settings**: shows options to set flow name, description, scheduling, sharing, etc.
* **Save**: saves the flow.
* **Schedule Status**: indicates if this flow is configured to automatically run on a schedule.
* **Alert Status**: indicates if this flow is configured as a [Consumer for an Alert](#define-a-consumer).
* **Debug**: runs the flow.
* **Deubg Context**: indicates which debug context (if any) will be used when debugging the flow. [Read more](#define-a-consumer)
* **Edit Debug Context**: opens a debug context editor.
* **Delete**: delete the selected node.
* **Delete all**: delete all nodes (requires confirmation).
* **Disable Node**: disables the selected node [Read more](#disabled-flow-nodes)
* **Enable Node**: enables the selected node [Read more](#disabled-flow-nodes)
* **Export flow**: download the flow specification, for backup or sharing.
* **Import flow**: upload a previously-exported flow spec.
* **Fit all nodes on screen**: zoom & center the canvas so that *all* nodes are visible.
* **Fullscreen**: puts the editor into fullscreen mode.

## Configuring Nodes

Expand Down Expand Up @@ -65,6 +69,17 @@ If we modify the If node's config so the statement is `search.Count < 1` and re-

![](debug-if-false.png)

### Debugging with Contexts

When designing a flow that will be consumed by an alert, it can be useful to simulate dispatching an alert. Debug contexts allow you to build artificial alert payloads which are provided to your flow during debug runs.

```{note}
Debug contexts are only relevant for **alert consumers**. If your flow runs on a schedule, it will not be provided a context when it is executed by the Search Agent.
```

To learn more about debugging with contexts, see our docs on [Defining a Consumer](#define-a-consumer).

(disabled-flow-nodes)=
## Enabled vs Disabled Nodes

Individual nodes in a flow can be disabled in order to execute parts of a flow without running the entire flow. This feature can be useful for troubleshooting or debugging a flow. For example, one may disable an Email node while troubleshooting a flow in order to avoid sending unnecessary emails.
Expand Down
Binary file modified flows/editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flows/node-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified flows/run-debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d57679e

Please sign in to comment.