1"use strict";(self.webpackChunkkubevela_io=self.webpackChunkkubevela_io||[]).push([[2461],{28453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>d});var s=t(96540);const o={},c=s.createContext(o);function i(e){const n=s.useContext(c);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(c.Provider,{value:n},e.children)}},55531:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>d,default:()=>l,frontMatter:()=>i,metadata:()=>s,toc:()=>a});const s=JSON.parse('{"id":"end-user/workflow/dependency","title":"Dependency","description":"This section will introduce how to specify dependencies for workflow steps.","source":"@site/docs/end-user/workflow/dependency.md","sourceDirName":"end-user/workflow","slug":"/end-user/workflow/dependency","permalink":"/docs/next/end-user/workflow/dependency","draft":false,"unlisted":false,"editUrl":"https://github.com/kubevela/kubevela.io/edit/main/docs/end-user/workflow/dependency.md","tags":[],"version":"current","lastUpdatedBy":"jguionnet","lastUpdatedAt":1754969455000,"frontMatter":{"title":"Dependency"},"sidebar":"docs","previous":{"title":"Sub Steps","permalink":"/docs/next/end-user/workflow/step-group"},"next":{"title":"Data Passing","permalink":"/docs/next/end-user/workflow/inputs-outputs"}}');var o=t(74848),c=t(28453);const i={title:"Dependency"},d=void 0,p={},a=[{value:"How to use",id:"how-to-use",level:2},{value:"Expected outcome",id:"expected-outcome",level:2}];function r(e){const n={admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.p,{children:"This section will introduce how to specify dependencies for workflow steps."}),"\n",(0,o.jsxs)(n.admonition,{type:"note",children:[(0,o.jsxs)(n.p,{children:["In the version ",(0,o.jsx)(n.code,{children:"<=1.4"}),", the steps in the workflow are executed sequentially, which means that there is an implicit dependency between steps, ie: the next step depends on the successful execution of the previous step. At this point, specifying dependencies in the workflow may not make much sense."]}),(0,o.jsxs)(n.p,{children:["In versions ",(0,o.jsx)(n.code,{children:"1.5+"}),", you can display the execution method of the specified workflow steps (eg: change to DAG parallel execution). At this time, you can control the execution of the workflow by specifying the dependencies of the steps."]})]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-use",children:"How to use"}),"\n",(0,o.jsxs)(n.p,{children:["In KubeVela, the dependencies between steps can be specified by ",(0,o.jsx)(n.code,{children:"dependsOn"})," in the steps."]}),"\n",(0,o.jsx)(n.p,{children:"For example: we want to send a message notification after deploying the component:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-yaml",children:"...\nworkflow:\n steps:\n - name: comp\n type: apply-component\n - name: notify\n type: notification\n dependsOn:\n - comp\n"})}),"\n",(0,o.jsxs)(n.p,{children:["In this case, KubeVela waits for the completion of the step ",(0,o.jsx)(n.code,{children:"comp"})," before executing the ",(0,o.jsx)(n.code,{children:"notify"})," step to send a message notification."]}),"\n",(0,o.jsx)(n.p,{children:"Apply the following YAML:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-yaml",children:"apiVersion: core.oam.dev/v1beta1\nkind: Application\nmetadata:\n name: dependsOn-app\n namespace: default\nspec:\n components:\n - name: express-server\n type: webservice\n properties:\n image: oamdev/hello-world\n ports:\n - port: 8000\n workflow:\n steps:\n - name: comp\n type: apply-component\n properties:\n component: express-server\n - name: slack-message\n type: notification\n dependsOn:\n - comp\n properties:\n slack:\n url:\n value: <your slack url>\n message:\n text: depends on comp\n"})}),"\n",(0,o.jsx)(n.h2,{id:"expected-outcome",children:"Expected outcome"}),"\n",(0,o.jsxs)(n.p,{children:["Use ",(0,o.jsx)(n.code,{children:"vela status"})," to check the status of the Application:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"$ vela status depends\nAbout:\n\n Name: \tdepends\n Namespace: \tdefault\n Created at:\t2022-06-24 17:20:50 +0800 CST\n Status: \trunning\n\nWorkflow:\n\n mode: StepByStep\n finished: true\n Suspend: false\n Terminated: false\n Steps\n - id:e6votsntq3\
1n name:comp\n type:apply-component\n phase:succeeded\n message:\n - id:esvzxehgwc\n name:slack-message\n type:notification\n phase:succeeded\n message:\n\nServices:\n\n - Name: express-server\n Cluster: local Namespace: default\n Type: webservice\n Healthy Ready:1/1\n No trait applied\n"})}),"\n",(0,o.jsx)(n.p,{children:"As you can see, all step statuses are succeeded. And when the component is successfully deployed, a message is also sent in slack."})]})}function l(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(r,{...e})}):r(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.