diff --git a/Jenkinsfile-att-workflow b/Jenkinsfile-att-workflow
new file mode 100644
index 0000000..6247ca5
--- /dev/null
+++ b/Jenkinsfile-att-workflow
@@ -0,0 +1,278 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// 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.
+
+node ("${TestNodeName}") {
+    timeout (240) {
+        try {
+            stage ("Parse deployment configuration file") {
+                sh returnStdout: true, script: 'rm -rf ${configRepoBaseDir}'
+                sh returnStdout: true, script: 'git clone -b ${branch} ${configRepoUrl}'
+                deployment_config = readYaml file: "${configRepoBaseDir}${configRepoFile}"
+            }
+            stage('Clone POD configurations') {
+                timeout(5) {
+                    sh returnStdout: true, script: """
+                    rm -rf helm-charts
+                    rm -rf config-files
+                    git clone -b ${branch} https://gerrit.opencord.org/helm-charts
+                    git clone https://bitbucket.org/onfcord/podconfigs.git config-files
+                    """
+                }
+            }
+            stage('Clean up') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=${deployment_config.kube_config}
+                    helm ls | grep att-workflow && helm delete --purge att-workflow || true
+                    helm ls | grep base-kubernetes && helm delete --purge base-kubernetes || true
+                    helm ls | grep xos-core && helm delete --purge xos-core || true
+                    helm ls | grep onos-fabric && helm delete --purge onos-fabric || true
+                    helm ls | grep onos-voltha && helm delete --purge onos-voltha || true
+                    helm ls | grep voltha && helm delete --purge voltha || true
+                    """
+                    // Wait for helm delete
+                    timeout(5) {
+                        waitUntil {
+                            helm_deleted = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            helm ls | grep -E 'onos-voltha|onos-fabric|voltha\$|base-kubernetes|xos-core|att-workflow' | wc -l
+                            """
+                            return helm_deleted.toInteger() == 0
+                        }
+                    }
+                    timeout(5) {
+                        waitUntil {
+                            kubectl_deleted = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods --all-namespaces | grep -E 'onos-voltha|onos-fabric|att-workflow|base-kubernetes-|xos-' | wc -l
+                            """
+                            voltha_namespace_deleted = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get namespace | grep voltha | wc -l
+                            """
+                            return kubectl_deleted.toInteger() + voltha_namespace_deleted.toInteger() == 0
+                        }
+                    }
+                }
+            }
+            dir ("helm-charts") {
+                // stage('Install Voltha Kafka') {
+                //     timeout(10) {
+                //         sh returnStdout: true, script: """
+                //         export KUBECONFIG=${deployment_config.kube_config}
+                //         helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
+                //         helm install -f ../config-files/seba-values.yaml --name voltha-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka
+                //         """
+                //     }
+                //     timeout(10) {
+                //         waitUntil {
+                //             kafka_instances_running = sh returnStdout: true, script: """
+                //             export KUBECONFIG=${deployment_config.kube_config} &&
+                //             kubectl get pods | grep voltha-kafka | grep -i running | grep 1/1 | wc -l
+                //             """
+                //             return kafka_instances_running.toInteger() == 2
+                //         }
+                //     }
+                // }
+                stage('Install voltha') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
+                        helm dep build voltha
+                        helm install -f ../config-files/seba-values.yaml -n voltha voltha
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            voltha_completed = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l
+                            """
+                            return voltha_completed.toInteger() == 8
+                        }
+                    }
+                }
+                stage('Install ONOS-Voltha') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm install -f ../config-files/seba-values.yaml -n onos-voltha -f configs/onos-voltha.yaml onos
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            onos_voltha_completed = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods | grep -i onos-voltha | grep -i running | grep 1/1 | wc -l
+                            """
+                            return onos_voltha_completed.toInteger() == 1
+                        }
+                    }
+                }
+                stage('Install ONOS-Fabric') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm install -f ../config-files/seba-values.yaml -n onos-fabric -f configs/onos-fabric.yaml onos
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            onos_fabric_completed = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods | grep -i onos-fabric | grep -i running | grep 1/1 | wc -l
+                            """
+                            return onos_fabric_completed.toInteger() == 1
+                        }
+                    }
+                }
+                stage('Install xos-core') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm dep update xos-core
+                        helm install -f ../config-files/seba-values.yaml -n xos-core xos-core                                
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            xos_core_completed = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l
+                            """
+                            return xos_core_completed.toInteger() == 7
+                        }
+                    }
+                }
+                stage('Install att-workflow') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm dep update xos-profiles/att-workflow
+                        helm install -f ../config-files/seba-values.yaml -n att-workflow xos-profiles/att-workflow
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            att_workflow_tosca_completed = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l
+                            """
+                            return att_workflow_tosca_completed.toInteger() == 1
+                        }
+                    }
+                }
+                // stage('Install CORD Kafka') {
+                //     timeout(10) {
+                //         sh returnStdout: true, script: """
+                //         export KUBECONFIG=${deployment_config.kube_config}
+                //         helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
+                //         helm install -f ../config-files/seba-values.yaml --name cord-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka
+                //         """
+                //     }
+                //     timeout(10) {
+                //         waitUntil {
+                //             kafka_instances_running = sh returnStdout: true, script: """
+                //             export KUBECONFIG=${deployment_config.kube_config} &&
+                //             kubectl get pods | grep cord-kafka | grep -i Running | grep 1/1 | wc -l
+                //             """
+                //             return kafka_instances_running.toInteger() == 2
+                //         }
+                //     }
+                // }
+                stage('Install base-kubernetes') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=${deployment_config.kube_config}
+                        helm dep update xos-profiles/base-kubernetes
+                        helm install -f ../config-files/seba-values.yaml -n base-kubernetes xos-profiles/base-kubernetes
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            base_kubernetes_tosca_running = sh returnStdout: true, script: """
+                            export KUBECONFIG=${deployment_config.kube_config} &&
+                            kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l
+                            """
+                            return base_kubernetes_tosca_running.toInteger() == 1
+                        }
+                    }
+                }
+            }
+            stage('Restart OLT processes') {
+                for(int i=0; i < deployment_config.olts.size(); i++) {
+                    timeout(5) {
+                        sh returnStdout: true, script: """
+                        ssh-keyscan -H ${deployment_config.olts[i].ip} >> /home/ubuntu/.ssh/known_hosts
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist stop' || true
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt stop' || true
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/bal_core_dist.log'
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/openolt.log'
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist start &'
+                        sleep 5
+                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt start &'
+                        """
+                    }
+                    timeout(15) {
+                        waitUntil {
+                            onu_discovered = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cat /var/log/openolt.log | grep \"olt indication, oper_state:up\" | wc -l'"
+                            return onu_discovered.toInteger() > 0
+                        }
+                    }
+                }
+            }
+            dir ("config-files") {
+                stage('Configure R-CORD - Fabric and whitelist') {
+                    timeout(1) {
+                        waitUntil {
+                            out_fabric = sh returnStdout: true, script: """
+                            cd tosca/att-workflow &&
+                            curl -s -H "xos-username: admin@opencord.org" -H "xos-password: letmein" -X POST --data-binary @pod-configuration.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l
+                            """
+                            return out_fabric.toInteger() == 1
+                        }
+                    }
+                }
+                stage('Configure R-CORD - Subscriber') {
+                    timeout(1) {
+                        waitUntil {
+                            out_subscriber = sh returnStdout: true, script: """
+                            cd tosca/att-workflow &&
+                            curl -s -H 'xos-username: admin@opencord.org' -H 'xos-password: letmein' -X POST --data-binary @subscriber.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l
+                            """
+                            return out_subscriber.toInteger() == 1
+                        }
+                    }
+                }
+                stage('Configure R-CORD - OLT') {
+                    timeout(1) {
+                        waitUntil {
+                            out_olt = sh returnStdout: true, script: """
+                            cd tosca/att-workflow &&
+                            curl -H 'xos-username: admin@opencord.org' -H 'xos-password: letmein' -X POST --data-binary @pod-olt.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l
+                            """
+                            return out_olt.toInteger() == 1
+                        }
+                    }
+                }
+            }
+            currentBuild.result = 'SUCCESS'
+        } catch (err) {
+            currentBuild.result = 'FAILURE'
+            step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmails}", sendToIndividuals: false])
+        }
+        echo "RESULT: ${currentBuild.result}"
+    }
+}
