activateWorkflow method

Future<Response> activateWorkflow(
  1. String id, {
  2. String? versionId,
  3. String? name,
  4. String? description,
})

Activate a workflow

Implementation

Future<Response> activateWorkflow(String id, {
  String? versionId,
  String? name,
  String? description,
}) async {
  try {
    final response = await _dio.post(
      '/workflows/$id/activate',
      data: {
        if (versionId != null) 'versionId': versionId,
        if (name != null) 'name': name,
        if (description != null) 'description': description,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to activate workflow: ${e.message}');
  }
}