diff --git a/vid-app-common/jest.config.js b/vid-app-common/jest.config.js
index e9ca59b..3f72db3 100644
--- a/vid-app-common/jest.config.js
+++ b/vid-app-common/jest.config.js
@@ -7,10 +7,10 @@
     "<rootDir>/src/main/webapp/app/vid/external"
   ],
   setupFilesAfterEnv: ["<rootDir>/test-config.js"],
-  collectCoverage: true,
+  collectCoverage: false,
   collectCoverageFrom: [
     "src/**/*.js",
     "!**/node_modules/**",
     "!**/vendor/**"
   ]
-};
\ No newline at end of file
+};
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
index a472268..a82dfab 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
@@ -30,7 +30,6 @@
 import org.onap.vid.mso.MsoBusinessLogicImpl;
 import org.onap.vid.mso.MsoInterface;
 import org.onap.vid.mso.MsoProperties;
-import org.onap.vid.mso.rest.MockedWorkflowsRestClient;
 import org.onap.vid.mso.rest.MsoRestClientNew;
 import org.onap.vid.services.CloudOwnerService;
 import org.onap.vid.services.CloudOwnerServiceImpl;
@@ -54,10 +53,6 @@
             MsoProperties.MSO_SERVER_URL),httpsAuthClient);
     }
 
-    @Bean
-    public MockedWorkflowsRestClient mockedWorkflowsClient(ObjectMapper unirestObjectMapper){
-        return new MockedWorkflowsRestClient(new SyncRestClient(unirestObjectMapper), "http://vid-simulator:1080/");
-    }
 
     @Bean
     public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient, FeatureManager featureManager){
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/WorkflowsController.java b/vid-app-common/src/main/java/org/onap/vid/controller/WorkflowsController.java
index a6ad923..1d0ff95 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/WorkflowsController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/WorkflowsController.java
@@ -62,10 +62,6 @@
         return externalWorkflowsService.getWorkflows(vnfModelId);
     }
 
-    @RequestMapping(value = "remote-workflow-parameters/{id}", method = RequestMethod.GET)
-    SOWorkflowParameterDefinitions getParameters(@PathVariable Long id) {
-        return externalWorkflowsService.getWorkflowParameterDefinitions(id);
-    }
 
     @RequestMapping(value = "local-workflow-parameters/{name}", method = RequestMethod.GET)
     LocalWorkflowParameterDefinitions getParameters(@PathVariable String name) {
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt b/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt
index b88c3f6..00cc7b9 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/model/SOWorkflows.kt
@@ -20,9 +20,18 @@
 
 package org.onap.vid.model
 
+import com.google.common.collect.Lists
+
+enum class WorkflowSource(val source: String) {
+    SDC("sdc"), NATIVE("native")
+}
+
 data class SOWorkflow constructor(
-        val id: Long,
-        val name: String) {
+        val id: String,
+        val name: String,
+        val source: WorkflowSource,
+        val workflowInputParameters: List<WorkflowInputParameter>
+) {
     fun clone(): SOWorkflow {
         return copy()
     }
@@ -79,3 +88,50 @@
     }
 }
 
+
+data class ArtifactInfo constructor(
+        val artifactType: String,
+        val artifactUuid: String,
+        val artifactName: String,
+        val artifactVersion: String,
+        val artifactDescription: String? = null,
+        val workflowName: String,
+        val operationName: String? = null,
+        val workflowSource: String,
+        val workflowResourceTarget: String
+)
+
+data class ActivitySequenceItem constructor(
+        val name: String,
+        val description: String
+)
+
+data class WorkflowInputParameter constructor(
+        val label: String,
+        val inputType: String,
+        val required: Boolean,
+        val validation: List<InputParameterValidation>? = Lists.newArrayList(),
+        val soFieldName: String,
+        val soPayloadLocation: String?,
+        val description: String?
+
+)
+
+data class InputParameterValidation constructor(
+        val maxLength: String?,
+        val allowableChars: String?
+)
+
+data class WorkflowSpecification constructor(
+        val artifactInfo: ArtifactInfo,
+        val activitySequence: List<ActivitySequenceItem>? = Lists.newArrayList(),
+        val workflowInputParameters: List<WorkflowInputParameter>
+)
+
+data class WorkflowSpecificationWrapper constructor(
+        val workflowSpecification: WorkflowSpecification
+)
+
+data class SOWorkflowList constructor(
+        val workflowSpecificationList: List<WorkflowSpecificationWrapper>? = Lists.newArrayList()
+)
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
index 1ff30f0..3b2cdb1 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
@@ -3,6 +3,7 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright 2019 Nokia
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +24,7 @@
 import org.onap.vid.changeManagement.RequestDetailsWrapper;
 import org.onap.vid.changeManagement.WorkflowRequestDetail;
 import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.model.SOWorkflowList;
 import org.onap.vid.model.SoftDeleteRequest;
 import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
 import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
@@ -138,4 +140,5 @@
 
     MsoResponseWrapper2 activateFabricConfiguration(String serviceInstanceId, RequestDetails requestDetails);
 
+    SOWorkflowList getWorkflowListByModelId(String modelVersionId);
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
index ad07eac..64c405a 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
@@ -8,9 +8,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,26 +26,44 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import io.joshworks.restclient.http.HttpResponse;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.vid.changeManagement.ChangeManagementRequest;
 import org.onap.vid.changeManagement.RequestDetailsWrapper;
-import org.onap.vid.changeManagement.UIWorkflowsRequest;
 import org.onap.vid.changeManagement.WorkflowRequestDetail;
-import org.onap.vid.controller.ControllersUtils;
 import org.onap.vid.controller.OperationalEnvironmentController;
 import org.onap.vid.exceptions.GenericUncheckedException;
 import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.model.SOWorkflowList;
 import org.onap.vid.model.SoftDeleteRequest;
-import org.onap.vid.mso.model.*;
+import org.onap.vid.mso.model.CloudConfiguration;
+import org.onap.vid.mso.model.ModelInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.model.RequestInfo;
+import org.onap.vid.mso.model.RequestParameters;
 import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
-import org.onap.vid.mso.rest.*;
+import org.onap.vid.mso.rest.RelatedInstance;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestList;
+import org.onap.vid.mso.rest.RequestWrapper;
+import org.onap.vid.mso.rest.Task;
+import org.onap.vid.mso.rest.TaskList;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.togglz.core.manager.FeatureManager;
 
 import javax.ws.rs.BadRequestException;
 import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -54,8 +72,16 @@
 import static java.util.stream.Collectors.toList;
 import static org.apache.commons.lang.StringUtils.upperCase;
 import static org.onap.vid.changeManagement.ChangeManagementRequest.MsoChangeManagementRequest;
-import static org.onap.vid.controller.MsoController.*;
-import static org.onap.vid.mso.MsoProperties.*;
+import static org.onap.vid.controller.MsoController.CONFIGURATION_ID;
+import static org.onap.vid.controller.MsoController.REQUEST_TYPE;
+import static org.onap.vid.controller.MsoController.SVC_INSTANCE_ID;
+import static org.onap.vid.controller.MsoController.VNF_INSTANCE_ID;
+import static org.onap.vid.controller.MsoController.WORKFLOW_ID;
+import static org.onap.vid.mso.MsoProperties.MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS;
+import static org.onap.vid.mso.MsoProperties.MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE;
+import static org.onap.vid.mso.MsoProperties.MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE;
+import static org.onap.vid.mso.MsoProperties.MSO_REST_API_OPERATIONAL_ENVIRONMENT_DEACTIVATE;
+import static org.onap.vid.mso.MsoProperties.MSO_REST_API_WORKFLOW_SPECIFICATIONS;
 import static org.onap.vid.properties.Features.FLAG_UNASSIGN_SERVICE;
 import static org.onap.vid.utils.Logging.debugRequestDetails;
 
@@ -97,7 +123,7 @@
         this.featureManager = featureManager;
     }
 
-    public static String    validateEndpointPath(String endpointEnvVariable) {
+    public static String validateEndpointPath(String endpointEnvVariable) {
         String endpoint = SystemProperties.getProperty(endpointEnvVariable);
         if (endpoint == null || endpoint.isEmpty()) {
             throw new GenericUncheckedException(endpointEnvVariable + " env variable is not defined");
@@ -404,7 +430,7 @@
         }
     }
 
-        private List<Task> deserializeManualTasksJson(String manualTasksJson) {
+    private List<Task> deserializeManualTasksJson(String manualTasksJson) {
         logInvocationInDebug("deserializeManualTasksJson");
 
         ObjectMapper mapper = new ObjectMapper();
@@ -558,6 +584,20 @@
         return new MsoResponseWrapper2<>(msoClientInterface.post(path, new RequestDetailsWrapper<>(requestDetails), RequestReferencesContainer.class));
     }
 
+    @Override
+    public SOWorkflowList getWorkflowListByModelId(String modelVersionId) {
+        logInvocationInDebug("getWorkflowListByModelId");
+        String pathTemplate = validateEndpointPath(MSO_REST_API_WORKFLOW_SPECIFICATIONS);
+        String path = pathTemplate.replaceFirst("<model_version_id>", modelVersionId);
+
+        HttpResponse<SOWorkflowList> workflowListByModelId = msoClientInterface.getWorkflowListByModelId(path);
+        if (!isSuccessful(workflowListByModelId)) {
+            logger.error(EELFLoggerDelegate.errorLogger, workflowListByModelId.getStatusText());
+            throw new WorkflowListException(String.format("Get worklflow list for id: %s failed due to %s", modelVersionId, workflowListByModelId.getStatusText()));
+        }
+        return workflowListByModelId.getBody();
+    }
+
 
     @Override
     public MsoResponseWrapperInterface updateVnfSoftware(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) {
@@ -842,6 +882,18 @@
         logger.debug(EELFLoggerDelegate.debugLogger, methodName + e.toString());
     }
 
+    private boolean isSuccessful(HttpResponse<SOWorkflowList> workflowListByModelId) {
+        int status = workflowListByModelId.getStatus();
+        return HttpStatus.OK.value() == status || HttpStatus.ACCEPTED.value() == status;
+    }
+
+    static class WorkflowListException extends RuntimeException{
+
+        WorkflowListException(String message) {
+            super(message);
+        }
+    }
+
     enum RequestType {
 
         CREATE_INSTANCE("createInstance"),
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
index 904ba13..9befc0f 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
@@ -22,6 +22,7 @@
 
 import io.joshworks.restclient.http.HttpResponse;
 import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.model.SOWorkflowList;
 import org.onap.vid.changeManagement.WorkflowRequestDetail;
 import org.onap.vid.mso.rest.RequestDetails;
 
@@ -114,6 +115,8 @@
 
     MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath);
 
+    HttpResponse<SOWorkflowList> getWorkflowListByModelId(String endpoint);
+
     MsoResponseWrapper invokeWorkflow(WorkflowRequestDetail requestDetails,String invokeWorkflowsPath,  Map<String, String> extraHeaders);
 
     <T> HttpResponse<T> get(String path, Class<T> responseClass);
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
index 47cb95f..4e6258c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
@@ -125,4 +125,6 @@
 
 	/** The Constant MSO_REST_API_SERVICE_INSTANCE_ASSIGN */
 	public static final String MSO_REST_API_SERVICE_INSTANCE_ASSIGN = "mso.restapi.serviceInstanceAssign";
+
+	public static final String MSO_REST_API_WORKFLOW_SPECIFICATIONS= "mso.restapi.changeManagement.workflowSpecifications";
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MockedWorkflowsRestClient.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MockedWorkflowsRestClient.java
deleted file mode 100644
index 54ee646..0000000
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MockedWorkflowsRestClient.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.vid.mso.rest;
-
-import java.util.Collections;
-import org.jetbrains.annotations.NotNull;
-import org.onap.vid.client.SyncRestClient;
-import org.onap.vid.model.SOWorkflowParameterDefinitions;
-import org.onap.vid.model.SOWorkflows;
-import org.onap.vid.mso.MsoResponseWrapper2;
-
-public class MockedWorkflowsRestClient {
-
-    private SyncRestClient syncRestClient;
-    private String baseUrl;
-
-    public MockedWorkflowsRestClient(SyncRestClient syncRestClient, String baseUrl) {
-        this.syncRestClient = syncRestClient;
-        this.baseUrl = baseUrl;
-    }
-
-    public MsoResponseWrapper2<SOWorkflows> getWorkflows(String vnfName) {
-        // Temporary skip vnfName and call mocked service
-        return new MsoResponseWrapper2<>(syncRestClient
-            .get(getWorkflowsUrl(),
-                Collections.emptyMap(),
-                Collections.emptyMap(),
-                SOWorkflows.class));
-    }
-
-    public MsoResponseWrapper2<SOWorkflowParameterDefinitions> getWorkflowParameterDefinitions(Long workflowId) {
-        return new MsoResponseWrapper2<>(syncRestClient
-                .get((workflowId <= 3 && workflowId > 0) ? getParametersUrl(workflowId) : getParametersUrl(),
-                        Collections.emptyMap(),
-                        Collections.emptyMap(),
-                        SOWorkflowParameterDefinitions.class));
-    }
-
-    @NotNull
-    private String getWorkflowsUrl() {
-        return baseUrl + "so/workflows";
-    }
-
-
-    @NotNull
-    private String getParametersUrl() {
-        return baseUrl + "so/workflow-parameters";
-    }
-
-    @NotNull
-    private String getParametersUrl(Long workflowId) {
-        return baseUrl + "so/workflow-parameters/" + workflowId;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index ff7acff..0c05b80 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -21,6 +21,7 @@
 package org.onap.vid.mso.rest;
 
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
 import io.joshworks.restclient.http.HttpResponse;
 import io.joshworks.restclient.http.JsonNode;
 import java.text.DateFormat;
@@ -40,6 +41,7 @@
 import org.onap.vid.changeManagement.WorkflowRequestDetail;
 import org.onap.vid.client.SyncRestClient;
 import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.model.SOWorkflowList;
 import org.onap.vid.mso.MsoInterface;
 import org.onap.vid.mso.MsoProperties;
 import org.onap.vid.mso.MsoResponseWrapper;
@@ -473,6 +475,12 @@
     }
 
 
+    public HttpResponse<SOWorkflowList> getWorkflowListByModelId(String endpoint){
+        String path = baseUrl + endpoint;
+
+        return client.get(path, commonHeaders, Maps.newHashMap(), SOWorkflowList.class);
+    }
+
     private MsoResponseWrapper createInstance(Object request, String path) {
         String methodName = "createInstance";
         logger.debug(methodName + START);
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsService.java b/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsService.java
index 2eae52f..4620eed 100644
--- a/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsService.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * VID
  * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,10 +22,8 @@
 
 import java.util.List;
 import org.onap.vid.model.SOWorkflow;
-import org.onap.vid.model.SOWorkflowParameterDefinitions;
+
 
 public interface ExternalWorkflowsService {
     List<SOWorkflow> getWorkflows(String vnfModelId);
-
-    SOWorkflowParameterDefinitions getWorkflowParameterDefinitions(Long workflowId);
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsServiceImpl.java
index e03b546..0648b6a 100644
--- a/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ExternalWorkflowsServiceImpl.java
@@ -2,14 +2,14 @@
  * ============LICENSE_START=======================================================
  * VID
  * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,60 +20,48 @@
 
 package org.onap.vid.services;
 
-import java.util.List;
+import org.onap.vid.model.ArtifactInfo;
 import org.onap.vid.model.SOWorkflow;
-import org.onap.vid.model.SOWorkflowParameterDefinitions;
-import org.onap.vid.model.SOWorkflows;
-import org.onap.vid.mso.MsoResponseWrapper2;
-import org.onap.vid.mso.rest.MockedWorkflowsRestClient;
+import org.onap.vid.model.SOWorkflowList;
+import org.onap.vid.model.WorkflowSource;
+import org.onap.vid.model.WorkflowSpecification;
+import org.onap.vid.mso.MsoBusinessLogic;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
 @Service
 public class ExternalWorkflowsServiceImpl implements ExternalWorkflowsService {
 
-    private MockedWorkflowsRestClient mockedWorkflowsRestClient;
+    private MsoBusinessLogic msoService;
 
     @Autowired
-    public ExternalWorkflowsServiceImpl(MockedWorkflowsRestClient mockedWorkflowsRestClient) {
-        this.mockedWorkflowsRestClient = mockedWorkflowsRestClient;
+    public ExternalWorkflowsServiceImpl(MsoBusinessLogic msoService) {
+        this.msoService = msoService;
     }
 
     @Override
     public List<SOWorkflow> getWorkflows(String vnfModelId) {
-        MsoResponseWrapper2<SOWorkflows> msoResponse = mockedWorkflowsRestClient.getWorkflows(vnfModelId);
-        validateSOResponse(msoResponse, SOWorkflows.class);
-        return convertMsoResponseToWorkflowList(msoResponse);
+        SOWorkflowList workflowListByModelId = msoService.getWorkflowListByModelId(vnfModelId);
+        List<SOWorkflow> soWorkflows = new ArrayList<>();
+        Objects.requireNonNull(workflowListByModelId
+                .getWorkflowSpecificationList())
+                .forEach(
+                        workflow -> soWorkflows.add(convertWorkflow(workflow.getWorkflowSpecification()))
+                );
+
+        return soWorkflows;
     }
 
-    @Override
-    public SOWorkflowParameterDefinitions getWorkflowParameterDefinitions(Long workflowId) {
-        MsoResponseWrapper2<SOWorkflowParameterDefinitions> msoResponse = mockedWorkflowsRestClient.getWorkflowParameterDefinitions(workflowId);
-        validateSOResponse(msoResponse, SOWorkflowParameterDefinitions.class);
-        return (SOWorkflowParameterDefinitions) msoResponse.getEntity();
+    private SOWorkflow convertWorkflow(WorkflowSpecification workflow) {
+        ArtifactInfo artifactInfo = workflow.getArtifactInfo();
+
+        return new SOWorkflow(artifactInfo.getArtifactUuid(),
+                artifactInfo.getWorkflowName(),
+                WorkflowSource.valueOf(artifactInfo.getWorkflowSource().toUpperCase()),
+                workflow.getWorkflowInputParameters());
     }
-
-    private List<SOWorkflow> convertMsoResponseToWorkflowList(MsoResponseWrapper2<SOWorkflows> msoResponse) {
-        SOWorkflows soWorkflows = (SOWorkflows) msoResponse.getEntity();
-        return soWorkflows.getWorkflows();
-    }
-
-    private void validateSOResponse(MsoResponseWrapper2 response, Class<?> expectedResponseClass){
-        if (response.getStatus() >= 400 || !expectedResponseClass.isInstance(response.getEntity())) {
-            throw new BadResponseFromMso(response);
-        }
-    }
-
-    public static class BadResponseFromMso extends RuntimeException {
-        private final MsoResponseWrapper2<?> msoResponse;
-
-        BadResponseFromMso(MsoResponseWrapper2<?> msoResponse) {
-            this.msoResponse = msoResponse;
-        }
-
-        public MsoResponseWrapper2<?> getMsoResponse() {
-            return msoResponse;
-        }
-    }
-
 }
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index f8202fb..246834c 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -390,11 +390,9 @@
             workflowParameters.requestDetails.cloudConfiguration = vm.changeManagement.vnfNames[0].cloudConfiguration;
 
             let parameters = vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow);
-            let i = 1;
             parameters.forEach((parameter)=>{
-                let inputField = document.getElementById('so-workflow-parameter-'+i);
-                i++;
-                workflowParameters.requestDetails.requestParameters.userParams[0][parameter.name]=inputField.value;
+                let inputField = document.getElementById('so-workflow-parameter-'+parameter.soFieldName);
+                workflowParameters.requestDetails.requestParameters.userParams[0][parameter.soFieldName]=inputField.value;
             });
 
             return workflowParameters;
@@ -402,40 +400,60 @@
 
         vm.openModal = function () {
             if(vm.hasScheduler) { //scheduling supported
-				$scope.widgetParameter = ""; // needed by the scheduler?
-
-				// properties needed by the scheduler so it knows whether to show
-				// policy or sniro related features on the scheduler UI or not.
-				vm.changeManagement.policyYN = "Y";
-				vm.changeManagement.sniroYN = "Y";
-
-			            if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_ADD_MSO_TESTAPI_FIELD)) {
-			                vm.changeManagement.testApi = DataService.getMsoRequestParametersTestApi();
-			            }
-				var data = {
-					widgetName: 'Portal-Common-Scheduler',
-					widgetData: vm.changeManagement,
-					widgetParameter: $scope.widgetParameter
-				};
-
-				window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
+                vm.scheduleWorkflow();
 			} else {
-				//no scheduling support
-				var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement);
-                if(dataToSo) {
-                    var vnfName = vm.changeManagement.vnfNames[0].name;
-                    changeManagementService.postChangeManagementNow(dataToSo, vnfName);
-                }
+                //no scheduling support
+                vm.executeWorkflow();
+            }
+        };
 
+		vm.scheduleWorkflow = function () {
+            $scope.widgetParameter = ""; // needed by the scheduler?
+
+            // properties needed by the scheduler so it knows whether to show
+            // policy or sniro related features on the scheduler UI or not.
+            vm.changeManagement.policyYN = "Y";
+            vm.changeManagement.sniroYN = "Y";
+
+            if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_ADD_MSO_TESTAPI_FIELD)) {
+                vm.changeManagement.testApi = DataService.getMsoRequestParametersTestApi();
+            }
+            var data = {
+                widgetName: 'Portal-Common-Scheduler',
+                widgetData: vm.changeManagement,
+                widgetParameter: $scope.widgetParameter
+            };
+
+            window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
+        };
+
+        vm.executeWorkflow = function () {
+            if (vm.localWorkflows && vm.localWorkflows.length > 0) {
+                vm.triggerLocalWorkflow();
+            } else {
+                vm.triggerRemoteWorkflow();
+            }
+        };
+
+        vm.triggerLocalWorkflow = function () {
+            var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement);
+            if (dataToSo) {
+                var vnfName = vm.changeManagement.vnfNames[0].name;
+                changeManagementService.postChangeManagementNow(dataToSo, vnfName);
+            }
+        };
+
+        vm.triggerRemoteWorkflow = function () {
+            let cachedWorkflowDetails = vm.getCachedWorkflowDetails(vm.changeManagement.workflow);
+            if (cachedWorkflowDetails.length > 0) {
                 let workflowParameters = getWorkflowParametersFromForm();
-                if(workflowParameters){
+                if (workflowParameters) {
                     let servieInstanceId = vm.changeManagement.vnfNames[0]['service-instance-node'][0].properties['service-instance-id'];
                     let vnfInstanceId = vm.changeManagement.vnfNames[0].id;
-                    let workflow_UUID = vm.changeManagement.fromVNFVersion;
-
-                    changeManagementService.postWorkflowsParametersNow(servieInstanceId,vnfInstanceId,workflow_UUID,workflowParameters);
+                    let workflow_UUID = cachedWorkflowDetails[0].id;
+                    changeManagementService.postWorkflowsParametersNow(servieInstanceId, vnfInstanceId, workflow_UUID, workflowParameters);
                 }
-			}
+            }
         };
 
         vm.loadSubscribers = function () {
@@ -728,13 +746,37 @@
         };
 
         vm.loadRemoteWorkFlowParameters = function (workflow) {
-          changeManagementService.getSOWorkflowParameter(workflow.id)
-          .then(function (response) {
-            vm.remoteWorkflowsParameters.set(workflow.name, response.data.parameterDefinitions);
-          })
-          .catch(function (error) {
-            $log.error(error);
-          });
+            let parameters = [];
+            workflow.workflowInputParameters
+                .filter( function (param) {
+                    return param.soPayloadLocation === "userParams"
+                })
+                .forEach(function (param) {
+                    let workflowParams = vm.repackAttributes(param);
+                    if (param.validation.length > 0) {
+                        let validation = param.validation[0];
+                        if ('maxLength' in validation) {
+                            workflowParams.maxLength = validation.maxLength;
+                        }
+                        if ('allowableChars' in validation) {
+                            workflowParams.pattern = validation.allowableChars;
+                        }
+                    }
+                    parameters.push(workflowParams);
+                }
+            );
+            vm.remoteWorkflowsParameters.set(workflow.name, parameters);
+        };
+
+        vm.repackAttributes = function (workflowParam){
+            return {
+                name: workflowParam.label,
+                required: workflowParam.required,
+                id: workflowParam.soFieldName,
+                soFieldName: workflowParam.soFieldName,
+                maxLength: '500',
+                pattern: '.*'
+            }
         };
 
         vm.getRemoteWorkFlowParameters = function (workflow) {
@@ -757,6 +799,13 @@
           }
         };
 
+        vm.getCachedWorkflowDetails = function (workflow) {
+            return vm.remoteWorkflows.filter( function (remoteWorkflow) {
+                return remoteWorkflow.name === workflow;
+            });
+
+        };
+
         //Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
         $scope.selectFileForVNFName = function (fileInput) {
             if (fileInput && fileInput.id) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
index 9810c00..5989ffd 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js
@@ -100,32 +100,59 @@
           }
         ],
       }});
-    let getSOWorkflowsPromiseStub = Promise.resolve({"data": [{"id": "1", "name": "workflow 1"}, {"id": "2", "name": "workflow 2"}]});
-    let getSOWorkflowsParametersPromiseStub = Promise.resolve({"data":{"parameterDefinitions": []}});
+    let getSOWorkflowsPromiseStub = Promise.resolve({"data":[{
 
-    $controller.changeManagement.vnfNames = [{name: 'test1'}, {name: "test2"}];
+        "id": "ab6478e4-ea33-3346-ac12-ab121484a333",
+        "workflowName": "inPlaceSoftwareUpdate",
+        "name": "inPlaceSoftwareUpdate",
+        "source": "sdc",
+        "workflowInputParameters": [
+            {
+                "label": "New Software Version",
+                "inputType": "text",
+                "required": true,
+                "soFieldName": "new_software_version",
+                "soPayloadLocation": "userParams",
+                "validation":[]
+            }
+        ]
+    }]
+    });
+
+    $controller.changeManagement.vnfNames = [{modelVersionId: 'test1', name:'test'}];
     $changeManagementService.getWorkflows = () => getWorkflowsStub;
     $changeManagementService.getLocalWorkflowParameter = () => getLocalWorkflowsParametersStub;
     $changeManagementService.getSOWorkflows = () =>  getSOWorkflowsPromiseStub;
-    $changeManagementService.getSOWorkflowParameter = () =>  getSOWorkflowsParametersPromiseStub;
     // when
     return $controller.loadWorkFlows().then(() => {
-      expect($controller.workflows).toContain('workflow 1');
-      expect($controller.workflows).toContain('workflow 2');
+      expect($controller.workflows).toContain('inPlaceSoftwareUpdate');
+      expect($controller.localWorkflowsParameters).toBeUndefined();
     });
   });
 
-  test('Verify load workflows will call load workflows parameters from SO', () => {
+  test('Verify load workflows will set workflows and parameters', () => {
     // given
     let getWorkflowsStub = Promise.resolve({"data": {"workflows": ["workflow 0"]}});
     let getLocalWorkflowsParametersStub = Promise.resolve({"data": {}});
-    let getSOWorkflowsPromiseStub = Promise.resolve({"data": [{"id": "1", "name": "workflow 0"}]});
-    let getSOWorkflowsParametersPromiseStub = Promise.resolve({"data":{"parameterDefinitions": [
-          {"id": 1, "name": "parameter 1", "required": true, "type": "STRING", "pattern": "[0-9]*"},
-          {"id": 2, "name": "parameter 2", "required": true, "type": "STRING", "pattern": ".*"},
-          {"id": 3, "name": "parameter 3", "required": false, "type": "STRING", "pattern": "[0-9]*"}]}});
+    let getSOWorkflowsPromiseStub = Promise.resolve({"data":[{
 
-    $controller.changeManagement.vnfNames = [{name: 'test1'}, {name: "test2"}];
+            "id": "ab6478e4-ea33-3346-ac12-ab121484a333",
+            "workflowName": "inPlaceSoftwareUpdate",
+            "name": "inPlaceSoftwareUpdate",
+            "source": "sdc",
+          "workflowInputParameters": [
+            {
+              "label": "New Software Version",
+              "inputType": "text",
+              "required": true,
+              "soFieldName": "new_software_version",
+              "soPayloadLocation": "userParams",
+                "validation":[]
+            }
+          ]
+        }]
+      });
+    $controller.changeManagement.vnfNames = [{modelVersionId: 'test1', name:'test'}];
     $changeManagementService.getWorkflows = () => getWorkflowsStub;
     $changeManagementService.getLocalWorkflowParameter = () => getLocalWorkflowsParametersStub;
     $changeManagementService.getSOWorkflows = () =>  getSOWorkflowsPromiseStub;
@@ -133,10 +160,17 @@
     // when
     return $controller.loadWorkFlows()
     .then(() => {
-      expect($controller.remoteWorkflowsParameters).toEqual(new Map([["workflow 0",
-        [{"id": 1, "name": "parameter 1", "pattern": "[0-9]*", "required": true, "type": "STRING"},
-         {"id": 2, "name": "parameter 2", "pattern": ".*", "required": true, "type": "STRING"},
-         {"id": 3, "name": "parameter 3", "pattern": "[0-9]*", "required": false, "type": "STRING"}]]]));
+      expect($controller.workflows).toEqual(["inPlaceSoftwareUpdate"]);
+      expect($controller.remoteWorkflowsParameters).toEqual(new Map([["inPlaceSoftwareUpdate",
+        [{
+          "name": "New Software Version",
+          "required": true,
+          "id": "new_software_version",
+          "soFieldName": "new_software_version",
+          "maxLength": '500',
+          "pattern": '.*'
+        }]]
+      ]));
     });
   });
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index 9fb978c..a5a6d16 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -97,7 +97,7 @@
 
         <div class="form-group" ng-if="vm.changeManagement.workflow" ng-repeat="item in vm.getRemoteWorkFlowParameters(vm.changeManagement.workflow)">
           <label for="so-workflow-parameter-{{item.id}}" class="control-label">{{item.name}}</label>
-          <input  ng-model="item.value" type="text" id="so-workflow-parameter-{{item.id}}" pattern="{{item.pattern}}" ng-required="{{item.required}}">
+          <input  ng-model="item.value" type="text" id="so-workflow-parameter-{{item.id}}" pattern="{{item.pattern}}" maxlength="{{item.maxLength}}" ng-required="{{item.required}}" soFieldName="{{item.soFieldName}}">
         </div>
     </div>
 
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java
index 11bf364..4494f48 100644
--- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java
@@ -28,7 +28,7 @@
 import org.jetbrains.annotations.NotNull;
 import org.mockito.hamcrest.MockitoHamcrest;
 import org.onap.vid.changeManagement.WorkflowRequestDetail;
-import org.onap.vid.controller.ControllersUtils;
+import org.onap.vid.model.SOWorkflowList;
 import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -78,6 +78,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.ArgumentMatchers.isA;
@@ -103,6 +104,12 @@
     private MsoInterface msoInterface;
 
     @Mock
+    private SOWorkflowList workflowList;
+
+    @Mock
+    private HttpResponse<SOWorkflowList> workflowListResponse;
+
+    @Mock
     private RequestDetails msoRequest;
 
 
@@ -1357,6 +1364,26 @@
         assertThat(response).isEqualToComparingFieldByField(okResponse);
     }
 
+
+    @Test
+    public void shouldReturnWorkflowListForGivenModelId() {
+        given(msoInterface.getWorkflowListByModelId(anyString())).willReturn(workflowListResponse);
+        given(workflowListResponse.getBody()).willReturn(workflowList);
+        given(workflowListResponse.getStatus()).willReturn(HttpStatus.ACCEPTED.value());
+
+        SOWorkflowList workflows = msoBusinessLogic.getWorkflowListByModelId("sampleModelId");
+
+        assertThat(workflows).isEqualTo(workflowList);
+    }
+
+    @Test(expectedExceptions = {MsoBusinessLogicImpl.WorkflowListException.class})
+    public void shouldRaiseExceptionWhenRetrievingWorkflowsFailed() {
+        given(msoInterface.getWorkflowListByModelId(anyString())).willReturn(workflowListResponse);
+        given(workflowListResponse.getStatus()).willReturn(HttpStatus.INTERNAL_SERVER_ERROR.value());
+
+        msoBusinessLogic.getWorkflowListByModelId("sampleModelId");
+    }
+
     private WorkflowRequestDetail createWorkflowRequestDetail() {
         WorkflowRequestDetail workflowRequestDetail = new WorkflowRequestDetail();
         org.onap.vid.changeManagement.RequestParameters requestParameters = new org.onap.vid.changeManagement.RequestParameters();
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowServiceImplTest.java
deleted file mode 100644
index 160ba97..0000000
--- a/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowServiceImplTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.vid.services;
-
-
-
-import com.google.common.collect.Lists;
-import io.joshworks.restclient.http.HttpResponse;
-import java.util.Collections;
-import java.util.List;
-
-import org.assertj.core.api.Assertions;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.onap.vid.model.SOWorkflow;
-import org.onap.vid.model.SOWorkflowParameterDefinition;
-import org.onap.vid.model.SOWorkflowParameterDefinitions;
-import org.onap.vid.model.SOWorkflowType;
-import org.onap.vid.model.SOWorkflows;
-import org.onap.vid.mso.MsoResponseWrapper2;
-import org.onap.vid.mso.rest.MockedWorkflowsRestClient;
-import org.onap.vid.services.ExternalWorkflowsServiceImpl.BadResponseFromMso;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class ExternalWorkflowServiceImplTest {
-
-    @Mock
-    private MockedWorkflowsRestClient client;
-    @Mock
-    private HttpResponse<SOWorkflows> response;
-
-    @Mock
-    private HttpResponse<SOWorkflowParameterDefinitions> parameterDefinitionsHttpResponse;
-
-
-    @BeforeMethod
-    public void init(){
-        MockitoAnnotations.initMocks(this);
-    }
-
-    @Test
-    public void shouldReturnWorkflowsOnValidResponse(){
-        // given
-        ExternalWorkflowsService extWorkflowsService = new ExternalWorkflowsServiceImpl(client);
-        Mockito.when(response.getStatus()).thenReturn(200);
-        Mockito.when(response.getBody()).thenReturn(new SOWorkflows(Collections.singletonList(new SOWorkflow(1L, "xyz"))));
-        MsoResponseWrapper2<SOWorkflows> msoResponseStub = new MsoResponseWrapper2<>(response);
-        Mockito.when(client.getWorkflows("test")).thenReturn(msoResponseStub);
-        // when
-        List<SOWorkflow> workflows = extWorkflowsService.getWorkflows("test");
-        // then
-        Mockito.verify(client).getWorkflows("test");
-        Assertions.assertThat(workflows.get(0).getName()).isEqualTo("xyz");
-    }
-
-    @Test(expectedExceptions = BadResponseFromMso.class)
-    public void shouldThrowBadResponseOnInvalidResponse(){
-        // given
-        ExternalWorkflowsService extWorkflowsService = new ExternalWorkflowsServiceImpl(client);
-        Mockito.when(response.getStatus()).thenReturn(500);
-        Mockito.when(response.getBody()).thenReturn(new SOWorkflows(Collections.singletonList(new SOWorkflow(1L, "xyz"))));
-        MsoResponseWrapper2<SOWorkflows> msoResponseStub = new MsoResponseWrapper2<>(response);
-        Mockito.when(client.getWorkflows("test")).thenReturn(msoResponseStub);
-        // when
-        extWorkflowsService.getWorkflows("test");
-        // then throw exception
-    }
-    @Test
-    public void shouldReturnWorkflowParametersOnValidResponse() {
-        SOWorkflowParameterDefinitions parameters = new SOWorkflowParameterDefinitions(Collections.singletonList(new SOWorkflowParameterDefinition(1L, "sample", "[0-9]", SOWorkflowType.STRING, true)));
-        ExternalWorkflowsService extWorkflowsService = new ExternalWorkflowsServiceImpl(client);
-        Mockito.when(parameterDefinitionsHttpResponse.getStatus()).thenReturn(200);
-        Mockito.when(parameterDefinitionsHttpResponse.getBody()).thenReturn(parameters);
-        MsoResponseWrapper2<SOWorkflowParameterDefinitions> msoResponseWrapper = new MsoResponseWrapper2<>(parameterDefinitionsHttpResponse);
-        Mockito.when(client.getWorkflowParameterDefinitions(1L)).thenReturn(msoResponseWrapper);
-
-
-        SOWorkflowParameterDefinitions workflowParameterDefinitions = extWorkflowsService.getWorkflowParameterDefinitions(1L);
-
-        Assertions.assertThat(workflowParameterDefinitions).isEqualTo(parameters);
-    }
-
-    @Test
-    public void shouldProperlyHandleEmptyParametersList(){
-        ExternalWorkflowsService extWorkflowsService = new ExternalWorkflowsServiceImpl(client);
-        Mockito.when(parameterDefinitionsHttpResponse.getStatus()).thenReturn(200);
-        Mockito.when(parameterDefinitionsHttpResponse.getBody()).thenReturn(new SOWorkflowParameterDefinitions(Lists.newArrayList()));
-
-        MsoResponseWrapper2<SOWorkflowParameterDefinitions> msoResponseWrapper = new MsoResponseWrapper2<>(parameterDefinitionsHttpResponse);
-        Mockito.when(client.getWorkflowParameterDefinitions(1L)).thenReturn(msoResponseWrapper);
-
-
-        SOWorkflowParameterDefinitions workflowParameterDefinitions = extWorkflowsService.getWorkflowParameterDefinitions(1L);
-        Assertions.assertThat(workflowParameterDefinitions.getParameterDefinitions()).isEmpty();
-    }
-}
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowsServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowsServiceImplTest.java
new file mode 100644
index 0000000..94771b2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/ExternalWorkflowsServiceImplTest.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.services;
+
+
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.vid.model.ArtifactInfo;
+import org.onap.vid.model.SOWorkflow;
+import org.onap.vid.model.SOWorkflowList;
+import org.onap.vid.model.WorkflowInputParameter;
+import org.onap.vid.model.WorkflowSource;
+import org.onap.vid.model.WorkflowSpecification;
+import org.onap.vid.model.WorkflowSpecificationWrapper;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+public class ExternalWorkflowsServiceImplTest {
+
+    @Mock
+    private MsoBusinessLogic msoBusinessLogic;
+
+
+    private static final UUID SAMPLE_UUID = UUID.randomUUID();
+
+    @BeforeMethod
+    public void init() {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test
+    public void shouldReturnWorkflowsOnValidResponse() {
+        // given
+        ExternalWorkflowsService extWorkflowsService = new ExternalWorkflowsServiceImpl(msoBusinessLogic);
+        WorkflowInputParameter parameter = new WorkflowInputParameter("sampleLabel", "text",
+                true, Collections.EMPTY_LIST, "sampleName", "userParams", "description");
+        SOWorkflowList workflowList = createWorkflowList(parameter);
+        SOWorkflow workflow = new SOWorkflow(SAMPLE_UUID.toString(), "sampleName", WorkflowSource.SDC, Collections.singletonList(parameter));
+        when(msoBusinessLogic.getWorkflowListByModelId("test")).thenReturn(workflowList);
+        // when
+        List<SOWorkflow> workflows = extWorkflowsService.getWorkflows("test");
+        // then
+        assertThat(workflows).hasSize(1).contains(workflow);
+    }
+
+    private SOWorkflowList createWorkflowList(WorkflowInputParameter parameter) {
+        ArtifactInfo artifactInfo = new ArtifactInfo("workflow", SAMPLE_UUID.toString(), "sampleArtifactName",
+                "sampleVersion", "sampleDescription", "sampleName", "sampleOperation", "sdc", "vnf");
+        WorkflowSpecification specification = new WorkflowSpecification(artifactInfo, Collections.EMPTY_LIST, Collections.singletonList(parameter));
+        WorkflowSpecificationWrapper wrapper = new WorkflowSpecificationWrapper(specification);
+        return new SOWorkflowList(Collections.singletonList(wrapper));
+    }
+
+}
diff --git a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
index 71f8eac..fce0d1a 100644
--- a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
+++ b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
@@ -170,6 +170,7 @@
 mso.restapi.serviceInstantiationApiRoot=/serviceInstantiation/v7
 mso.restapi.serviceInstanceCreate=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances
 mso.restapi.serviceInstanceAssign=${mso.restapi.serviceInstantiationApiRoot}/serviceInstances/assign
+mso.restapi.changeManagement.workflowSpecifications=/workflowSpecifications/v1/workflows?vnfModelVersionId=<model_version_id>
 
 vid.truststore.filename=/opt/app/vid/etc/vid_keystore.jks
 mso.dme2.client.timeout=30000
