Delete a Data Flow
Use the flows API to delete data flows and their associated resources. You can delete a flow from any point (data source, data set, or data sink) and choose whether to delete only downstream resources or the entire flow.
Delete Flow Endpoints
The flows API provides multiple endpoints for deleting flows, allowing you to delete from any resource in the flow:
- Nexla API
# Delete from flow node
DELETE /flows/{flow-node-id}
# Delete from data source
DELETE /data_sources/{data-source-id}/flow
# Delete from data set
DELETE /data_sets/{data-set-id}/flow
# Delete from data sink
DELETE /data_sinks/{data-sink-id}/flow
Delete Options
When deleting a flow, you have two main approaches to choose from. The default behavior is safer and more targeted, while the full deletion option removes the entire flow structure.
Delete Downstream Only (Default)
By default, deleting a flow removes only the specified resource and all downstream resources:
DELETE /data_sets/{data-set-id}/flow
This will delete:
- The specified data set
- All downstream data sets
- All downstream data sinks
- Associated transforms and data maps
Delete Entire Flow
To delete the entire flow including upstream resources, include the ?all=1
or ?full_tree=1
query parameter:
DELETE /data_sets/{data-set-id}/flow?all=1
DELETE /flows/{flow-node-id}?full_tree=1
This will delete:
- The entire flow from the origin data source
- All data sets in the flow
- All data sinks in the flow
- Associated transforms and data maps
Prerequisites
Before deleting a flow, ensure that:
- All Resources are Paused: Any
ACTIVE
resources in the data flow will cause the request to fail - Proper Permissions: You have the necessary permissions to delete the resources
- No Dependencies: Other flows or resources don't depend on the flow being deleted
Delete Response
The delete operation provides clear feedback about whether the deletion was successful or if there are issues that need to be resolved first.
A successful request to delete a data flow returns 200 OK
with no response body.
Failed Deletion (Active Resources)
If any resources in the flow are still active, the request will fail with a 405 Method Not Allowed
error:
- Nexla API
{
"data_sources": [5023],
"data_sets": [5059, 5061, 5062],
"data_sinks": [5029, 5030],
"message": "Active flow resources must be paused before flow deletion!"
}
Delete Flow Examples
The following examples demonstrate different deletion scenarios and how to use the various endpoints effectively.
Example 1: Delete from Data Source
Delete all flows originating from a specific data source:
DELETE /data_sources/5023/flow
Example 2: Delete from Data Set
Delete a data set and all downstream resources:
DELETE /data_sets/5061/flow
Example 3: Delete Entire Flow
Delete the entire flow from a downstream resource:
DELETE /data_sets/5061/flow?all=1
Example 4: Delete from Flow Node
Delete a flow starting from a specific flow node:
DELETE /flows/10001
Cascading Deletion
When you delete a flow, the following resources are automatically deleted:
- Data Sets: All downstream data sets in the flow
- Data Sinks: All data sinks associated with deleted data sets
- Transforms: All transforms applied to deleted data sets
- Data Maps: All data maps associated with deleted data sets
- Flow Nodes: All flow nodes in the deleted portion of the flow
Recovery Considerations
Important: Deleted flows cannot be recovered through the API. Consider the following before deletion:
- Export the Flow: Use the export functionality to create a backup
- Verify Dependencies: Ensure no other resources depend on the flow
- Documentation: Keep records of the flow configuration for potential recreation
Best Practices
- Always Pause First: Pause flows before attempting deletion
- Use Selective Deletion: Start with downstream-only deletion unless you need to remove the entire flow
- Export Before Deletion: Create backups of important flows
- Test in Non-Production: Test deletion workflows in development environments first
- Monitor Dependencies: Ensure deletion won't break other workflows
Legacy Endpoints
Note: The legacy /data_flows
endpoints are still available for backward compatibility but are deprecated:
DELETE /data_flows/data_source/{data_source_id}
DELETE /data_flows/{data_set_id}
DELETE /data_flows/data_sink/{data_sink_id}
It's recommended to use the new /flows
endpoints for all new development.