@ExecuteOn(TaskExecutors.IO)
    @Post(uri = "/export/by-ids", produces = MediaType.APPLICATION_OCTET_STREAM)
    @Operation(
        tags = {"Flows"},
        summary = "Export flows as a ZIP archive of yaml sources."
    )
    public HttpResponse<byte[]> exportByIds(
        @Parameter(description = "A list of tuple flow ID and namespace as flow identifiers") @Body List<IdWithNamespace> ids
    ) throws IOException {
        var flows = ids.stream()
            .map(id -> flowRepository.findByIdWithSource(tenantService.resolveTenant(), id.getNamespace(), id.getId()).orElseThrow())
            .toList();
        var bytes = zipFlows(flows);
        return HttpResponse.ok(bytes).header("Content-Disposition", "attachment; filename=\"flows.zip\"");
    }
@Test
    void exportByIds() throws IOException {
        List<IdWithNamespace> ids = List.of(
            new IdWithNamespace("io.kestra.tests", "each-object"),
            new IdWithNamespace("io.kestra.tests", "webhook"),
            new IdWithNamespace("io.kestra.tests", "task-flow"));
        byte[] zip = client.toBlocking().retrieve(HttpRequest.POST("/api/v1/flows/export/by-ids", ids),
            Argument.of(byte[].class));
        File file = File.createTempFile("flows", ".zip");
        Files.write(file.toPath(), zip);

        try(ZipFile zipFile = new ZipFile(file)) {
            assertThat(zipFile.stream().count(), is(3L));
        }

        file.delete();
    }