getWorkflows method

Future<Response> getWorkflows({
  1. bool? active,
  2. String? tags,
  3. String? name,
  4. String? projectId,
  5. bool? excludePinnedData,
  6. int? limit,
  7. String? cursor,
})

Retrieve all workflows

Implementation

Future<Response> getWorkflows({
  bool? active,
  String? tags,
  String? name,
  String? projectId,
  bool? excludePinnedData,
  int? limit,
  String? cursor,
}) async {
  try {
    final response = await _dio.get(
      '/workflows',
      queryParameters: {
        if (active != null) 'active': active,
        if (tags != null) 'tags': tags,
        if (name != null) 'name': name,
        if (projectId != null) 'projectId': projectId,
        if (excludePinnedData != null) 'excludePinnedData': excludePinnedData,
        if (limit != null) 'limit': limit,
        if (cursor != null) 'cursor': cursor,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to retrieve workflows: ${e.message}');
  }
}