Flows
List Flows
List all flows that exist in Directus.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
What metadata to return in the response.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
Options of the selected trigger for the flow.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
GET /flows
import { createDirectus, rest, readFlows } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readFlows(query));
POST /graphql/system
type Query {
flows: [directus_flows]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
],
"meta": {}
}
Create Multiple Flows
Create multiple new flows.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
Options of the selected trigger for the flow.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
Options of the selected trigger for the flow.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
POST /flows
import { createDirectus, rest, createFlows } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createFlows(flows_object_array));
POST /graphql/system
type Mutation {
create_flows_items(data: [create_directus_flows_input!]!): [directus_flows]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
],
"meta": {}
}
Delete Multiple Flows
Delete multiple existing flows.
Responses
DELETE /flows
import { createDirectus, rest, deleteFlows } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteFlows(flow_id_array));
POST /graphql/system
type Mutation {
delete_flows_items(ids: [ID!]!): delete_many
}
Update Multiple Flows
Update multiple flows at the same time.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
What metadata to return in the response.
How many items to skip when fetching data.
How to sort the returned items. sort
is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-
) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ?
to sort randomly.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Request Body
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
Options of the selected trigger for the flow.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
PATCH /flows
import { createDirectus, rest, updateFlows } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateFlows(flow_id_array, partial_flow_object));
POST /graphql/system
type Mutation {
update_flows_items(ids: [ID!]!, data: update_directus_flows_input): [directus_flows]
}
{
"data": [
{
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
],
"meta": {}
}
Create a Flow
Create a new flow.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
POST /flows
import { createDirectus, rest, createFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(createFlow(flow_object));
POST /graphql/system
type Mutation {
create_flows_item(data: create_directus_flows_input!): directus_flows
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
}
Retrieve a Flow
Retrieve a single flow by primary key.
Query Parameters
Unique identifier for the object.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
GET /flows/{id}
import { createDirectus, rest, readFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readFlow(flow_id, query_object));
POST /graphql/system
type Query {
flows_by_id(id: ID!): directus_flows
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
}
Delete a Flow
Delete an existing flow
Query Parameters
Unique identifier for the object.
Responses
DELETE /flows/{id}
import { createDirectus, rest, deleteFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(deleteFlow(flow_id));
POST /graphql/system
type Mutation {
delete_flows_item(id: ID!): delete_one
}
Update a Flow
Update an existing flow.
Query Parameters
Unique identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
Responses
Unique identifier for the flow.
The name of the flow.
Icon displayed in the Admin App for the flow.
Color of the icon displayed in the Admin App for the flow.
Current status of the flow.
Type of trigger for the flow. One of hook
, webhook
, operation
, schedule
, manual
.
The permission used during the flow. One of $public
, $trigger
, $full
, or UUID of a role.
UUID of the operation connected to the trigger in the flow.
Timestamp in ISO8601 when the flow was created.
The user who created the flow.
PATCH /flows/{id}
import { createDirectus, rest, updateFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(updateFlow(flow_id, partial_flow_object));
POST /graphql/system
type Mutation {
update_flows_item(id: ID!, data: update_directus_flows_input): directus_flows
}
{
"data": {
"id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
"name": "Update Articles Flow",
"icon": "bolt",
"color": null,
"status": "active",
"trigger": "manual",
"accountability": "$trigger",
"options": null,
"operation": "92e82998-e421-412f-a513-13701e83e4ce",
"date_created": "2022-05-11T13:14:52Z",
"user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
"operations": []
}
}
Flow with GET webhook trigger
Start a flow with GET webhook trigger.
Query Parameters
Identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
GET /flows/trigger/{id}
import { createDirectus, rest, triggerFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(triggerFlow('GET', flow_id, query_object));
// Not currently available in GraphQL
{}
Flow with POST webhook trigger
Start a flow with POST webhook trigger.
Query Parameters
Identifier for the object.
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
POST /flows/trigger/{id}
import { createDirectus, rest, triggerFlow } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(triggerFlow('POST', flow_id, webhook_payload));
// Not currently available in GraphQL
{}