getExecutions method

Future<Response> getExecutions({
  1. bool? includeData,
  2. String? status,
  3. String? workflowId,
  4. String? projectId,
  5. int? limit,
  6. String? cursor,
})

Retrieve all executions

Implementation

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