refactor(core): Include workflow ID in binary data writes (no-changelog) (#7220)

Depends on: https://github.com/n8n-io/n8n/pull/7195 | Story:
[PAY-837](https://linear.app/n8n/issue/PAY-837/implement-object-store-manager-for-binary-data)

This PR includes `workflowId` in binary data writes so that the S3
manager can support this filepath structure
`/workflows/{workflowId}/executions/{executionId}/binaryData/{binaryFilename}`
to easily delete binary data for workflows. Also all binary data service
and manager methods that take `workflowId` and `executionId` are made
consistent in arg order.

Note: `workflowId` is included in filesystem mode for compatibility with
the common interface, but `workflowId` will remain unused by filesystem
mode until we decide to restructure how this mode stores data.

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2023-09-25 18:04:52 +02:00
committed by GitHub
parent 75541e91f2
commit 77d6e3fc07
9 changed files with 121 additions and 70 deletions

View File

@@ -56,7 +56,7 @@ function dedupe<T>(arr: T[]): T[] {
}
export class Workflow {
id: string | undefined;
id: string;
name: string | undefined;
@@ -92,7 +92,7 @@ export class Workflow {
settings?: IWorkflowSettings;
pinData?: IPinData;
}) {
this.id = parameters.id;
this.id = parameters.id as string;
this.name = parameters.name;
this.nodeTypes = parameters.nodeTypes;
this.pinData = parameters.pinData;