Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Flows

Overview

Flows is AttackForge's end-to-end workflow automation engine, powered by AFScript. Use it to connect AttackForge with the other systems your team uses, and to automate the work in between.

For example, you can use Flows to:

Use case

Examples

Build custom workflows

Your own processes, approvals and reminders

Run AI agentic workflows

Start an AI agent from an Action, and let it read from and write back to AttackForge through AI MCP: enrich vulnerabilities, run penetration tests, retest findings, write executive summaries, and analyse attack chains. See AI agentic workflows.

Prioritise vulnerabilities with threat intelligence

Send vulnerabilities to ticketing systems

Send data to BI and reporting tools

Sync bug bounty findings

Sync with GRC tools

Chain Self-Service API calls

Several Self-Service RESTful API calls in one automation

Trigger and import scans

Send chat messages

Send webhooks and custom emails

Any system that accepts a webhook, or custom email notifications

Watch the Flows video.

Key terms

Term

Meaning

Flow

An automation. It has a name, a trigger, a sequence of actions, and secrets.

Trigger

What starts a Flow: an internal event, an external HTTP call, a schedule, or an Action clicked in the UI. A Flow has one trigger.

Action

One step in a Flow: an HTTP request, or a script.

Run

One execution of a Flow, from trigger to finish.

Flow Owner

The user a Flow belongs to and runs as.

Secret

An encrypted value, such as an API key, used in headers or scripts.

Why it matters

  • Connect your tools. Keep AttackForge in sync with ticketing, chat, BI, GRC and scanning tools, without manual copying.

  • Save time. Automate repetitive steps, such as raising tickets for new findings or chasing overdue risk acceptances.

  • Fit your process. Build workflows that match how your team works, not the other way round.

  • Stay in control. Flows run with their owner's access, and every run is logged.

Who uses it

Who

To

Administrators

Grant access to Flows and events, and oversee automations

Security engineers and automation builders

Build and maintain Flows and integrations

Security and practice leads

Automate team workflows, notifications and reporting

Testers and project managers

Run Flows from Actions in the UI

Get access to Flows

Flows is included with Enterprise and the Core SME plan. On other plans, add it from Administration > Subscriptions.

To build Flows, a user needs Create access to at least one trigger type. Administrators set this under Users > (select user) > Access > Flows.

Trigger type

Access levels

Notes

Event trigger

None, Run, Create

The user also needs access to the matching event.

HTTP trigger – Authentication (None)

None, Run, Create

For non-authenticated HTTP triggers.

HTTP trigger – Authentication (User API Key)

None, Run, Create

For authenticated HTTP triggers. Callers need a valid User Key

Schedule trigger

None, Run, Create

Action trigger

None, Run, Create

Run allows a user to trigger a Flow, however does not allow them to create their own flows.

Get access to events

To use event triggers, a user also needs access to the events. Administrators enable this under Users > (select user) > Access > Events. See Self-Service Events API.

Build your first Flow

This walkthrough uses the page's Jira example: when a vulnerability is created, raise a Jira issue, then save the issue key back on the vulnerability.

  1. Create the Flow and give it a name.

  2. Choose a trigger. Pick an internal event for new vulnerabilities e.g. vulnerability-created

  3. Add secrets for your Jira and AttackForge API credentials.

  4. Add Action 1: an HTTP Action that creates a Jira issue. Use the Request Script to build the issue from the vulnerability data.

  5. Add Action 2: an HTTP Action that updates the vulnerability, writing the Jira issue key into a custom field.

  6. Test it with Manually Run Flow and test data.

  7. Enable it, then watch its runs in Run Logs.

The sections below explain each part.

Flow overview

Each Flow is made up of:

  • Name

  • Trigger

  • Actions, run in sequence

  • Secrets

Triggers

A trigger starts a Flow Run. It can be an event, or a manual run. See also Self-Service Events API.

Trigger

Starts when

Example

Internal Events

Something changes in AttackForge

A vulnerability is created

External Events (HTTP triggers)

An external system sends data, such as a webhook. Other Flows can call them too.

A scanner sends results

Scheduled Events

At a set time, such as daily at 9 am or hourly

Every day, find vulnerabilities past their risk-acceptance date, reopen them, create a ticket and notify the owners

Action Events

A user clicks an Action in the UI. You can limit it to specific entities, so the Action appears only where it's relevant.

A "Send to Jira" button on vulnerabilities (example)

Internal Events

Internal events happen when something changes inside AttackForge. Access to them is granted to users or groups. See Events docs for a list of all supported events.

External Events

External events are HTTP triggers. They start a Flow when an external system sends data, typically through webhooks. They can also be called from other Flows.

Scheduled Events

Scheduled events start a Flow at set times, such as daily at 9 am or every hour.

Action Events

Action events start a Flow when a user clicks an Action in the AttackForge interface. You can scope them to specific entities, so the Action appears only where it's relevant.

Assign a trigger

A Flow can have only one trigger. You assign it when you create or edit the Flow.

HTTP trigger authentication

HTTP triggers can be:

  • Authenticated: the caller's User Key is checked in a custom header.

  • Non-authenticated: anyone with the Trigger URL can call it.

Callers need Trigger access to the Flow, unless they're the Flow Owner. See "Trigger access" below.

HTTP trigger URL

Each HTTP trigger has a unique Trigger URL and Trigger ID. If the trigger is non-authenticated, treat them as secrets. Click Regenerate to rotate both.

Trigger configuration

Choose what's redacted from the incoming request in run logs:

Option

What it does

Redact user API Key

Hides the caller's User Key

Redact all headers except specified

Hides every header except those you list (allowlist)

Redact specified headers

Hides only the headers you list (blocklist)

Actions

An Action is a single activity, or a sequence of activities run in order during a Flow Run. The output of each Action becomes the input to the next.

For example, a Flow that sends a vulnerability to Jira has two Actions:

  1. Write the Jira issue key back to the vulnerability, using the Update Vulnerability Self-Service API.

Action types

Type

What it does

HTTP Action

Sends an HTTP request to a Self-Service API or an external system, with optional scripts before and after. See Self-Service RESTful API.

Script Action

Runs your own logic, with no HTTP request. It receives Data from the previous Action and passes Data to the next.

Script Action

A Script Action has a single code editor. Use it between HTTP Actions to transform data or make decisions. For example: HTTP Action (fetch data) → Script Action (filter and reshape it) → HTTP Action (send it on).

HTTP Action

An HTTP Action is made up of a Request and a Response. You set:

Part

What it is

Method

GET, POST, PUT, PATCH or DELETE

URL

Where the request is sent

Verify Certificate

Whether to check the server's TLS certificate

Headers

The request headers

Request Script

Code that runs before the request is sent

Response Script

Code that runs after the response is received

You can set the method, URL and headers in the Action, or work them out in the Request Script and return them.

Methods

Supported methods are GET, POST, PUT, PATCH and DELETE. You can also set the method in the Request Script's return statement:

URL

The URL is where the request is sent. Set it in the Action, or build it in the Request Script. This is useful when part of the URL changes, such as an ID:

Headers

Set headers in the Action, or build them in the Request Script:

Request and response

Made up of

Request

An HTTP or HTTPS request: URL, Method, Headers, an optional Body, and the Request Script

Response

The server's reply: the Response Object, and the Response Script

Request Script

Code, Data and a Return Statement. Runs before the request.

Response Script

Code, Data and a Return Statement. Runs after the response.

Scripts

Code

Scripts are written in AFScript. You can:

  • Log values to the run logs. See AFScript logging

  • Click Run to test a script.

  • See stack traces when a script fails.

Data

Data is the context passed between scripts and Actions. Reference a value with:

The Data object

The Data object holds Data. In the first Action, it holds the event's fields, such as the vulnerability's data. Each step can add to it or override it for the next step.

Reference a value:

For example, store the vulnerability ID:

Find the project ID in the vulnerability's list of projects:

Pass values to the next step in the data key of the return statement:

The Data object in the Response Script is then:

To see the Data object, log it. The output appears in Run Logs:

You can also see each Action's Data in the run details, and set test data for Action Events.

The Response object

The Response object holds the server's reply. Reference a value with:

It has the following keys:

Key

What it holds

statusCode

headers

body

The response body, as a string

jsonBody

The response body as a JSON structure (if JSON response)

fileId

The id of the file, if a file was downloaded in the response

If the body is JSON, parse it before you use it:

Or use the jsonBody directly:

To see the Response object, log it:

The return statement

Every script ends with a return statement. It decides what happens next, and can change the request and pass data on. It has three parts:

Part

What it does

decision

What happens next. See "Decision" below.

request

Request Scripts only: changes the request before it's sent.

data

Passes data to the next script or Action.

Decision

Status

In a Request Script

In a Response Script

continue

Sends the request

Runs the next Action

next

Skips to the next Action, without sending the request. Use it for conditional steps.

Skips to the next Action

repeat

Runs the Action again. Use it to process a list, page through results, or retry with an updated payload. You can change Data between repeats.

Same as in a Request Script

abort

Ends the Flow with an error

Ends the Flow with an error

finish

Ends the Flow successfully

Ends the Flow successfully

The Request Script and Response Script behaviour for next and repeat.

Field

Required

Description

status

Yes

One of the statuses above.

message

No

A message for the run logs.

delay

No

How long to wait before the decision takes effect, in milliseconds. Minimum 0, maximum 86400000 (24 hours).

With a delay:

As a string:

Continue:

Next:

Repeat:

Abort:

Finish:

Request

In a Request Script, return request to change the request. Each field is optional. Any field you leave out uses the Action's setting.

Field

Description

url

Where the request is sent

body

The request body

headers

The request headers

method

GET, POST, PUT, PATCH or DELETE

Body:

Headers:

Method:

Summary

Return a summary from an action, request or response script and it appears right where the run is reported, so the person who clicked the button knows what happened.

Example when user runs the action - notice the notification next to Completed:

Clicking on the notification shows the user the summary message:

Data

Return data to pass values from the Request Script to the Response Script, and from the Response Script to the next Action.

In a Request Script:

In a Response Script, passing the values on:

Secrets

Secrets store sensitive values, such as passwords and API keys. They're encrypted. Flow Secrets are visible only to users with access to the Flow.

You can also reference your User Secrets. Because several Flows can use the same User Secret, you rotate it in one place.

Add a secret

  1. Click Secrets.

  2. Click Add Secret.

  3. Create a Local Secret, or select one of your User Secrets. Keys can contain letters, numbers and underscores.

Use secrets in headers

Set the header's type to Secret, then choose an existing secret or create one.

Use secrets in Request and Response Scripts

Select Use Secrets for the script, then reference the secret as:

Download and upload files

Download files

In the Action's Options, select Download Response. The response then includes a fileId, which later Actions can use.

Upload files

Upload a file you downloaded earlier by its fileId, using a multipart/form-data request. For example, attach a file from an external system to a vulnerability, or upload a generated report to a project.

Runs

A Run is one execution of a Flow, from its trigger to its finish. Each Run has a status, a start time, a duration and the Actions it took.

Important: Normal runs execute as the Flow Owner, and only for records the owner can access. Test runs can use test data at any time.

See every Run you can access in the Flows module, or the Runs for one Flow by clicking its name.

Run statuses

Status

Meaning

Running

The Run is in progress.

Completed

The Run finished successfully.

Failed

The Run ended with an error.

Dropped

The Run was a duplicate, so it didn't run.

Missed

The Run didn't happen at its scheduled time.

Terminated

Someone stopped the Run manually.

Run logs

Run logs show:

  • Run status: Completed or Failed

  • Event: what triggered the Run

  • Started and Duration (in milliseconds)

  • Actions: each Action in the Run

  • Data: the input and output Data for each Action

  • HTTP: the URL, method, headers, body, status code and response body

  • Logs: messages from your scripts

Run a Flow manually

Run a Flow on demand, with test data you can edit for the first Action. Use it to test a Flow before you enable it.

Re-run a Flow

Re-run a Flow with exactly the same input as a previous Run. The Event shows that it was re-run.

Get the result of an HTTP-triggered Run

HTTP-triggered Flows run asynchronously. The trigger returns a Flow Run Id. Use it to get the Run's result:

Add ?format=html for a page you can open in a browser. The example below is an unauthenticated request.

A successful response will appear as follows:

A failed response will appear as follows:

Share Flows with your team

Each Flow belongs to the user who created it, the Flow Owner. A Flow always runs as one user, its owner. You can transfer ownership (see "Transfer a Flow"). Only owners can share a Flow.

To share a Flow:

  1. Open the Flow's Settings.

  2. Click Add Access.

  3. Choose who to share with. Administrators can choose Roles, Groups or Users. Other users can choose Groups they belong to, or Users by email.

  4. Choose the Access Level and Trigger Access.

  5. Click Add to save.

Access levels

Level

Can

None

Nothing

Info

See the name, status, last run, trigger, whether it's enabled, owner and readme, and for HTTP triggers the method, URL and trigger ID

View

Everything in Info, plus all runs, actions, run details and logs, and export

Edit

Everything in View, plus edit, Save and Run, and disable the Flow

Trigger access

Trigger access controls who can start the Flow through an authenticated HTTP trigger, using their User Key in the nominated header.

Option

Can

No

Not trigger the Flow

Yes

Trigger the Flow with a valid User Key

Yes + Delegate

Trigger the Flow, and also link it to their own Actions and share those Actions

Override

Select Override to make sure a user gets exactly the access you assign, even if they'd get different access through a Role or Group. Click Add to save.

Note: Administrators can view all Flows.

Effective access

Owners can see who has access to a Flow, from Roles, Groups and Users combined, under Flow settings > Effective Access.

Manage Flows

Flow readme

Each Flow can have a readme. Use it to explain how the Flow works and how to run it, and to link to external documentation and contacts.

Import and export Flows

Click Export Flow to save a Flow as a .flow file. Use it to share a Flow, back it up, or use it as a template. Secret values aren't exported, but their key names are.

Click Import Flow to import a .flow file. Review it, add any secret values, then save.

Transfer a Flow

Because a Flow runs as its owner, you may need to transfer it, for example when someone leaves the team.

  1. Open Flow settings > Transfer.

  2. Select a user, or enter their email.

The new owner receives the Flow disabled. It runs again once they enable it.

Tips

  • Test before you enable. Use Manually Run Flow with test data, then check the Run logs.

  • Log as you build. Use Logger.debug to see Data and Response objects at each step.

  • Keep credentials in secrets. Never put API keys in scripts. Use User Secrets for keys shared across Flows, so you rotate them once.

  • Use authenticated HTTP triggers where you can. If a trigger is non-authenticated, protect its URL and regenerate it if it leaks.

  • Redact sensitive headers in Trigger configuration, so they don't appear in run logs.

  • Use a service account as the Flow Owner for team Flows, so they keep running when people change roles. See Working with Service Accounts.

  • Write a readme for every shared Flow: what it does, who owns it and how to fix it.

  • Export Flows before big changes, as a backup.

FAQ

Which plans include Flows? Enterprise and the Core SME plan. Other plans can add it from Administration > Subscriptions.

Why can't I create a Flow? You need Create access to at least one trigger type. Ask an administrator to set it under Users > (select user) > Access > Flows.

Can a Flow have more than one trigger? No. A Flow has one trigger.

Whose access does a Flow use? The Flow Owner's. Runs only cover records the owner can access.

What happens to my Flows if I leave? Transfer them to someone else. The new owner receives them disabled until they enable them.

How do I see why a Run failed? Open the Run's logs. They show each Action's Data, HTTP details and script logs.

How do I get the result of an HTTP-triggered Flow? Use the Flow Run Id it returns with the runs API. See "Get the result of an HTTP-triggered Run".

Are secrets included when I export a Flow? No. Secret key names are included, but not their values.

What language are scripts written in? AFScript.

How long can a delay be? Up to 86400000 milliseconds (24 hours).

Last updated