Cisco Customer Success - Video

Building workflows​

Playback confirmation!

Do you want to resume playing from last left location?

Chapter 1 Thumbnail
00:00
Series overview and session plan
Chapter 2 Thumbnail
02:03
From MOPs to durable workflows
Chapter 3 Thumbnail
05:24
Agenda and deployment options (CWM vs CNC module)
Chapter 4 Thumbnail
08:59
Architecture: engine, adapters, workers, resources, secrets
Chapter 5 Thumbnail
16:19
Workflow fundamentals: states, data flow, Serverless Workflow JSON
Chapter 6 Thumbnail
24:45
UI tour and Hello World workflow build
Chapter 7 Thumbnail
35:22
Control flow: operations, switches, parallel branches, JQ filters
Chapter 8 Thumbnail
58:11
Data transformation demo and references
Chapter 9 Thumbnail
01:06:25
Validations and forms with callbacks (human-in-the-loop)
Chapter 10 Thumbnail
01:17:41
Integrations: adapters, NSO/Webex demo, wrap-up

Transcript

Oh, so this series are three different sessions where Raspban was.00:00In the previous one showing us about the fundamentals of CWM and what is new in this new release together with the different applications that are out of the box from CWM. So it was very relevant, was very interesting. This time we are going to go a little bit into the details of.00:17Of what our workflow is, what are the different pieces that can help us to create complex workflows and to understand what is behind of all of these huge applications that we saw very robust applications that we saw with previous time, right? So now.00:37We will go a little basic, we will understand the concepts, we will understand the different pieces that are moving behind, right? And the 3rd session that will be next week will be focused on how CAWM can interact with other applications, right?00:57Okay, so my name is David Kissarah I'm a customer success specialist. We are focusing to support customers and to help the customers that have been invested in Cisco Cisco products to get the best from, from the products and to understand and to adopt these technologies, ok?01:15Today we are going to talk about building workflows and.01:35In Crosswork workflow manager, two.one, ok? That is one of the latest releases of CWM. We I will explain in a moment what are the two different ways that we will be calling, but for now let's keep it like this. You have here my email in case you would like to reach out.01:39After or you have any questions, please feel free to do it.01:59And let's get started. Okay, what we have here, and I believe most most of of us or most of the networking engineers that are working in the field or that are taking care of this part have been in this situation, right? But they.02:03Have the mop eh, the method of procedure, they need to execute it, right? And they need to check one by one, line by line, and they need to put everything.02:23Manual, right? Log into the to the to the devices, applying configurations, do the post checks, do the prechecks whenever it comes, right? And see that everything will go according to the mop, to the how it was defined in the beginning of paper, right?02:35And this is fine, but this document doesn't run automatically.02:55It doesn't run itself. What happened if there is an error? Is, is it a rollback prepared for that? No, we need to do it. We need to, to put hands on and lock one by one and do step by step on this case, right? So this document will be good but.02:59But it will not execute itself and it cannot check itself as well.03:19So by the end of this hour, I will give you using CWM, what will be the approach to create this kind of workflow using all of the different features from CWM in order to automate this kind of processes, right? And to make the life of the engineer.03:24Much easier and we can create much more complex automations that will solve more problems.03:44Okay. And here I put the comparison of three different things, a script, the script it will run top to bottom and once the shell finish, it will start the script, right? Eh.03:51The the state of the will leave only in the local variables and, and things like that. It's still automation, but it's not more than this running top to bottom. Then we can also have some orchestrator script that we can start adding more, I don't know, scheduling, we can add more logs for troubleshooting.04:11Putting.04:31But still in this case, we don't have memory, and we move to durable workflows. In this case, the state of the execution will be persistent. It will survive if the system restart or do if the system will resume, right? So here's where we are going to focus in.04:33In workflow manager, we will have all of these benefits, we will have all of these features that even if we want to wait for any specific approval, our workflow will do it. And at the time that we'll resume continue doing the rest of the steps. It can pass some time, we can program those kind of things, and everything will be more.04:53More robust, right? And it has much more different control of different aspects that will be very helpful for us for our automations.05:13Okay, just to to give a little bit of context how it's going to look the session in general, we will start with a little bit of the concepts we saw some of the programmatic and where we want to go with CWM and building the workflows. So during this session also I'm going to show some demos. I will try to join.05:24From the demo to the slides to don't, to don't make it someone autonomous so we will do that. And if you have any question in the meantime, please feel free to put it here in the chat and I think we also have available the questions and answers sections so you can also utilize it if you have any questions you can put it there.05:44Or in the chat, right? We have the rest of the team supporting.06:04Okay, what, what are the topics we are going to mention about CWM? What is our workflow, in the context of CWM, we will check some of the pieces and and the language that in CWM is being used.06:10In order to to design the workflows, very important in the workflows how the data is moving, so we will talk about about how the data moves within our workflow in cwm. Also how we can validate the information, the data.06:25In CWM, how we can reach other systems within, the application and finally, what is a mop actions to go to the solution, right? To build a full solution in, in CWM, that is something.06:43That was showing us previous session, but we will finalize to this part. Ok, as, as I mentioned in the beginning, we have, these two ways to install, workload automation and just to clarify because I probably will refer to CWM all the time, but.07:01We have the same product in CNC, can be consumed in CNC, but in CNC will be just a model that will be called workflow automation. CWM can also be installed in standalone, which in this case in that scenario will be called CWM.07:22When it's in the model of CNC, we will refer to workflow automation, ok? Just to be clear, but we are referring to the same product. Here I put it in the screen on the left side, how it's going to look like in the model within CNC across work network controller. This is the one that I'm going to use for.07:42For this demo. So we will be familiar to these sections. Where can we find the different options, device management, workflow automation, and in the administration section we will show in a moment is where all of the settings for workflows will be there, ok? When we have the standalone.08:02All of the application will be focused on that. So we see WM solutions and the the dashboard for the workflows only, right? When we are referring to the standalone version, but just to be clear, it's the same product just in two different ways of installation in a model in CNC.08:20On standalone, workflow automation, ok? Okay, so saying saying that what a workflow actually is, and for here, how where the.08:40The CWM seats. In this case we have this workflow engine that will have different ways to interact with different platforms and ways to control so we can also use the different APIs that has to interact with that and.08:59Connect with other systems if that's what we want. And in the workflow engine, we will have the doable step, we can define step by step different actions, different workflows, and it will survive in to the restart, right? That part and that are the different workers. Here we'll have different work.09:19That will help us to scale or to distribute accordingly. And on the bottom how CNC can communicate also with many other different.09:39Applications, different, different parts, right? Outside of the cross workflow manager as well. Here I put some of them, we will go into details a bit further, but for now, I just want to have it clear that, we'll have the.09:50Engine layer will have all of the part of the operators, portals, different things that we can connect as well with C CWM and CWM can also interact with many other different applications via the adapters that we are going to include, ok? So CWM is not.10:10Replacing any NSO or any other interfaces is going to help us to sequence, different actions, different implementations that we want to, to execute, right? And we also can make approvals and can make change of management much easier in our network.10:30Okay, we have four different pieces and I wanted to put it at the beginning because I will be referring a lot to those pieces within the presentation, so to have it clear when I'm mentioning to each of them, are four of them. The 1st one is.10:50This adapter. Adapter, it's not more than the code that will know how to talk.11:09To external systems, ok? It will be the code that will help us to talk to other systems eh, and it's called adapter. Then 2nd one, the worker is just the running process that will execute all of the different adapters activities and also other.11:16Other activities from CWM, but will help us to run those different processes accordingly.11:37Then the 3rd one is resource. In this resource is where all of the different, the target host will live, the port, the protocol, the host, so all of different credentials, let's say, well, all.11:45The whole port protocol, how we are going to talk, will be, will be stored according to each adapter. So if we are connecting to a different platform.12:03We need to know how we are going to connect to that, right? So this information will be stored in a resource. So we need to create each resource for each instance of the adapter we would like to talk, ok? We can talk, for instance, to three different nsos.12:14A network service orchestrator, right? We could talk to these three applications, and so we'll have one adapter, but we need three different resources with the information of each of them independently, just to have clear. And then the 4th one is where we are going to save the credentials or the token or.12:33The basic authentication according.12:53Do how we are going to connect to this external external systems, right? So our four elements that will be important at the moment of building workflows and talking to other systems. So what are them adapters?12:56Worker resources and secrets. Very simple, and I will show you in the where can we find them in the we once we go to that part. Okay, here we have, the different components, so we know what is a workflow eh the workflow.13:15It's basically a series of states and will be used and will be defined using serverless workflow EO, we will talk more in a moment. Then we have the job of the activities that is every time we execute a workflow, we will have this job. We can have two or three jobs from the same.13:35The workflow, meaning that we execute that workflow several times. So every time we execute a workflow, it will be a job created that will be this instance of the workflow running. Hope that part is clear. So for each job.13:55The workshops will be utilized, right, to scale, to distribute and to execute this part of the workflow. We also can define forms as in the part of user interface that will display and will fetch information, right? In case we want to have some sort of a.14:12Approval or some confirmation. This part of the form, it's also viable, right?14:32We have the adapters that I already mentioned, just methods to talk to different systems and we have the resources. The resources are directly linked to the adapter. For each instance of the adapter, we will need to define the resource is the what what I just mentioned in the previous slide. And we have the secret.14:38That the secret is also directly connect to the resource where all of, we will save all of the credentials for the resource that we are going to create for that specific adapter instance. I know that it sounds a little bit probably.14:58With a lot of things, but it's very simple, right? The adapter's resource secret, those three are connected, resource and secret is to create an instance from adapter. So this is not so much complicated.15:16Well here also we have scheduling, we can schedule a execution of workflows. Let's say if I want to run something every week, I can do it periodically and I can also program a specific timing in the future. It has also even handling, and as I mentioned.15:34We have the northbound interface to connect and to talk to CWM and let's say if we want to execute or we want to retrieve some information.15:52We can, we can do it. Ok, so talking about a specific one a workflow is within context, we have that a workflow, it's just.16:02And different series of steps and those steps will be called states, right? So workflow definition will transition through a series of steps called states.16:19Then the workflow transition between states by performing actions will incorporate their specific function. It's this function is basically just some logic and some data that will be processed in this case.16:35And if we go and we double click into one steps, we have that each state and with the action by default will receive all the data from the previous state. So between states, they will pass the data a output from the previous states.16:54So that's why it's important and I wanted to include it in this presentation to understand how the data is being passed in our workflows. So the previous state data output will send that data.17:13To the next state into the input data, ok? And finally, we'll provide the output, right? That will become the input to the following state again. So this is how it will happen. The input from one.17:27Will be the, the output from one will be the input of the next state and this is how all the data is transferred within a workflow in the different states that is being created, ok? So states is a very important word and we need to under to to understand and to.17:45Have it present at the moment of building the workloads into into CWM. Then the state will comprises of actions, right? Operations. Also we have the logic and we'll leverage functions and.18:03Will retry all of the different degradations that we define within the workflow definition, right? So.18:22They can apply data filters within the actions with regards to the data that will received or even it can generate themselves and produce as outputs.18:31According to what the action is being executed within the state. An state can have several actions and a state can have some filters and as we see here, we can filter how the, the data is entering to the state and also we can filter how the data is eh.18:46Exiting from our state. According to the, to the functions that are being executed within that specific state.19:07Okay, if we want to see how it looks the anatomy of our workflow and this is a little bit, maybe too much of code, but don't, don't worry in the in the graphical interface, we have the, we have the.19:16The part of the of the way where we can drag and drop different actions so that will be much easier, but for for now for the matter of the explanation of this theoretical part, I wanted to show this, this piece. So when you jump to the CWM, you are not like, oh, what is this? Okay.19:36It's not more than a JSON file, and here I will speak a little bit about serverless workflow specification that this is the language is it's called domain specific language. This this language that the workflows in CWM are being written.19:56Is vendor neutral declarative language and we can use YAML and Jason.20:17But for CWM we are using only Jason, so Jason will be our best friend for developing workflows in CWM and for other things as well, because all the data is represented in in Jason format.20:25So it will help us to orchestrate the workflows across different serverless platforms, these language, right? To identify, and it was chosen for CWM. It separates the different logic from what is under under the implementation, right? And it helps to improve portun.20:42Ability to reuse some of the different validation and and et cetera, so it's open source and it has this Apache license, right? The.two.zero just for for your information. We have this spec version that we have.21:02At the top and I highlighted and will be also specified within our workflows as you can see here specification version, this field will identify the version of of the serverless workflow that is being used by, by this specific document you are writing.21:22CWM is using the version zero.eight or zero.nine according to what capabilities you want to take for callback states and to execute forms. It's moving to the zero.nine but by default the zero.eight is the one that is specified.21:42And what can we find here? It incorporates different and definitions. Those are some of the most relevant that I wanted to to highlight here. Of course, there are different others according to how.22:02How robust our workflow will be, but mainly we'll have the name and the ID, just parameters to identify the workflow within our CWM application and we will have the version. We can also create different versions for the.22:18Same workflow so like that we can categorize according to that. And for this specific versioning, it's using a specific convention for, for versioning. Let me see if I have it, the the data here.22:38Semantic versioning, so how it is like if you have a major version when you are making compatible API, that will be a change in the 1st digit or if we have a minor or if we have a patch, we are just going to modify the different digits according to.22:58What the change was being made, right? So it's following this semantic versioning, just for you to know like as a, as a best practice, right? Then we have this, we have the start, we have data input schema in case we want to validate.23:16And to reject a bad payload before this workload is execute, so we can also define this part.23:36When we are using functions, we need to define the functions within CWM if we are using the interface and if we pull a drag and drop one of the functions, this part is being populated automatically, right? The same with the others, but it's just for you to know that if you want to write from the scratch.23:44This JSON file, you need to define all of the different things accordingly. Then we have the states. So this is the the body of the full workflow. You need to define the functions you're using, you need to define the states. So each different step, as we saw in the previous slide.24:04Right, you need to define every step, into here according to the logic and so on. So that has to be defined here. Within other options for error handling that also might be useful for you. But this is how it looks the structure. Now let's go to them.24:24To the interface to see how it looks this part and we we already saw the interface from previous session, but again, just for us to refresh, this is a CNC.24:45And here we will have the workflow automation module, right? That is it's here installed, so as I mentioned in the beginning I will use this workflow automation model here for, for the example.25:00And what can we find here? We have here, different parts. So the jobs that I mentioned every time we execute a workflow directly, we will see here in jobs or what is the status of that workflow? If we have different jobs running at the same time, it will appear here, right? So here we will have.25:15Different logging information, e.g., starting time, closing time, the tax related to that in many other different things. I don't want to go to it now. We have also tasks. So in case there is.25:36A form or a pause that we need to fulfill from the call book we did in a, in a workflow. Here they will show up, right? When we are defining the different workflows, the different forms, sorry, meaning the the forms to populate information or different things, they will be here.25:50Here we can create a form.26:10And there is also a way to import them if we have it in JSON, right? So that's also possible. And here, and this is where I'm going to focus now. Here is where the workflows, just a single monolith workflow, it's going to be stored. So all of the different workflows that are.26:12Into my CWM, they will be here, right? We can categorize and I'll show you later how to do this categorization if this is what we want for.26:32Creating an application. But for now let's go to the basics. We will just create a workflow. We can also import the workflow if we have the JSON pre created. Let's say you want to save it and store it in a, in a GitHub repo or something like that. That's possible.26:43Able to do it, right? If you want to be safe.27:03And then if you want to import it, you can just click here and select the file, the JSON file, and it will be imported. It's just a JSON, so not more than code. But in this case, if we want to create one from the very beginning, it will look something like this. It's, an interface, right?27:06Here we have the different versions, how we can see this part. For now I will close this.27:27Let's say we have the graphical piece that is not more than the blockings and the different moving pieces, that we have here the states that we can enter and we will go in a moment. I will explain what is there for now.27:33Just show the basic, some activities, if we can import other workflows I have predefined so I can call workflows inside of a workflow, that's also possible to do it. If we also want to, to do some events, we can define events. That's another topic I will not down.27:49Into it, but we can also add some event actions, right? For, for, for our workflow workflows creation.28:09Okay, if you are more a coder person and you like to see a lot of Json things, you can work in the code. Sometimes I I I also like to come here to make quick changes. It's sometimes faster rather than click here, click there and try to find, if I know what I want to change, I come to the code and I execute the change.28:19In this editor, in this editor, you can have the LinkedIn checking, so it checks the syntaxes of your workflow, if it's good or if there is something off, e.g., I will remove these curly brackets and automatically say tells me that there is a invalid json, right?28:39But so it's it's nice, it's helpful also.28:59You can install if you are using visual studio code, there is a module that you can extension sorry that you can install and you can also save and you can see the the plot I can show you how it looks. But it's not more than for developing of the code. It's not having any, any.29:04Functionalities just if you like to keep your.29:23Your workflows there, e.g., here, I have this, this example, and so I have the extension of, of serverless. When I am defining my workflow on the left side, it renders, but it's only graphical.29:26Right, if I'm saving it local and I want to see.29:46Okay I have here but not more than this NO connection, nothing. But it's good. I mean if if you if you like to to keep like this and then for documentation perhaps might be useful, so that's why I'm mentioning. But in this case, you have this editor, in CWM and you have also the graph. So let's make.29:49Make the 1st changes and let's execute a very basic workflow, like super basic. In this case, this is my interface. I am opening the part of the graph and I want to include e.g. inject that this inject state just will put some data into my workflow.30:09And this data remember that is passing step state by state, so at the end, all the data will be the data that we are entering, so I will remove this state and.30:29So I have here, now I need to configure my workflow. What I usually do, I do click outside of my actions or my state that I have here, click and I select here and it will open these specific workflow properties when I can start defining the different things.30:40So, e.g., now I haven't just copied here, so I will put the name, hello world, workflow demo. This is the name of my workflow. I can put the version, this is the very 1st version of this workflow, so will be the.zero.0.0100I can.31:00Put some descriptions inject hello world, exclamation mark and you can also put some tags if that's what you want. For now I don't want to deep dive into those details. Let's keep it very simple. So now this is, I will save it.31:20And I need to go now to the part of, I was defining there my general workflow. Now I want to define something in my state. I was, I wanted to add some data, so I will come here.31:39I will select when I click on top of the specific state on the right side I can start making some changes. So let's say this state I want to be called hello world state, right? And the data that will be injected to the workflow, I will put it here.31:55Hello world, and I will just the rest of the things are, are for other things right for error handling and time execution, where I will not focus on this just let's keep it very simple.32:16So I'm saving. Okay, now it's safe. So once we execute and perform all of the changes, we always need to go to my validation sown will tell us is whatever we put into those parts will be good. So it's ok.32:35And then I will create this workflow.32:55Once it's created, we have my 1st instance of a workflow. Perfect. Now I will run it. Once I run it, it will open this part. It's just another another another another form where I can put in a specific name to the job if this is.32:57What we want, if I want to assign tax.33:17Or some lock level, but I mean, you can come here and configure it. For now I want just to run it directly because you also can schedule here or define it in a crown mode as well. So let's keep it simple. In this case, it just inject, so we will see only the output of this hello world.33:21That we put and I will run it.33:41As I mentioned in the beginning, every time we run a workflow will be a job created. And we will need to go to the jobs section. So again, I will go and I will go to jobs. So in jobs, I see that Hello World workflow demo, has been executed and has been finished at this.33:44Specific time, right? I will open and here I can see input and the different results.34:04Of of the output, right? So the output of the workflow was this data. Always the data will be passed in this format Json, and here is what it retrieves the workflow. We just put an action that is injecting data, we put hello world, and this.34:11Action was giving it our output of the workflow. That is just not more than a hello world. But we see that everything has been green, it's completed and it was fresh, right? That was our 1st workflow. Here you also can see event history, so basically all of the different step.34:30Of execution of the workflow. Here are only twelve in case your workflow is more complex, of course this number of, of events will increase, and you can see details, right? I mean I can click but.34:50It says like all of of what was happening under, under the hood, right? To check this or that. So it's it's useful if you want to, to troubleshoot or to see what's going on under, right?35:05Perfect eh any questions with our 1st very 1st basic workflow? No questions so far in the chat except one asking if we're gonna share the slides at the end and I shared the link to the community.35:22Awesome. Thank you. Thank you Rasman. Perfect. Okay, so we saw our 1st execution of a workflow. So now.35:42Eh CWM has a lot of operations that will help us to, to build more complex logic in our workflows. For instance, we have the very 1st one that is operation. This operation is where we are going to put the different actions.35:53And Specifically for adapter activities and how to use the input for the inject state, you mean the the this is the one we built, i'm coming to here.36:12Okay, the input for inject state, in this case, in this specific scenario, the basic one, I was putting the input here. We will see in a moment how it works the data and in case we want to link it to a form, it will explain. For now this inject state, we put the data directly here into the.36:31Definition of my state, right? But we will see in a moment to make it more clear. This was just a basic one.36:51So we see the activities, e.g., those of these activities are, the operations that we saw here, all the different activities from the adapters. We also have switched conditions in case we want to create the logic if.36:59This, e.g., if this condition is true, then we will have two different ways to execute and so on. We will see in an example to make it clear. We can inject data and this is what I, what we saw now. We put, we put now directly the data.37:19We want it in the definition of of the status, but we could even refer to the to a specific variable coming from a previous state or we can even refer to the output of a get query from an external thing. So that's why this, this.37:38Inject.37:59Can be used for. So this part we have it. Now we put it statically in the definition, so that's why we don't see anything else. We can also use callbacks. We can pause and the workflow will pause and we will wait for an external event, different.38:00Different events can be, e.g., if we want that once we go to the point of the callback, the administrator needs to populate a form and then hit enter and continue, and we will check that example in a moment. That also can be possible.38:20We can run two different branches in parallel and we can define it and even create three for branches and that will then run in parallel. We can create loops.38:38And let's say we are fetching the different interfaces from one device and then we want to do something with that, we could create that workflow, right? Request of the interfaces, we will have a list of different interfaces. And then in the next we can do for each that basically will take.38:53Take every item of the list and we can perform actions on top of that. Let's think this as a programming language when we are using the four.39:12Or yeah, the four action in I don't know, in Python or something like this. This logic can be created in in here. We can create sub work sub flows in case we want to to call a different workflow as a child of one that we already have, and this is what I show you in the interface.39:21Right? Here we have some workflows.39:41We could pull one of these workflows into one new definition of the workflow, and that's also very useful because we can start making small parts and just joining according to our needs. Also, we can define a specific.39:44Sleep time, let's say if we want to stop something for a fixed duration of time, that's possible to do it. And in this point it's also worth it to mention that all of these sleeps and timeouts and things like that.40:04Are being defined with the ISO 8601 format. That is let me see if I can see quickly here one example. E.g. here state execution timeout. If we want to define the time it needs the specifically ISO 8601.40:21Let me put a bit of sum just for us to, to see, ok. And if we want to define 1 h will be PT one H If we want to define, e.g. 30 s will be PT 30S accordingly. But I mean you can find this.40:41A specific, ISO 601 and see how to build the time duration accordingly, right? But just for us to understand that CWM it's using this specific time notation. Okay.41:01Let me go move to the next one and now we will talk about how the data is moving and a very important part because it will, it will definitely help you to understand better their workflows and to me it did a lot.41:20So every workflow, will always begin with an input payload, right? It can be, let's say if we have a workflow that will be instantiated in a workflow, so the data that is exiting from the previous state will be the one inputting to this one. Or if we have.41:39Form before the data that is entering to this form will be that input. Or usually when you execute a workflow and in this case, I will execute this very basic one.41:59The input, if I don't have defined any, any form associated to this workflow or anything, the input to that workflow will be defined here, meaning we will need to paste in here the JSON with the information we want to enter.42:12To that specific workflow.42:32Okay, I hope that part is clear. If it's not associated any form, here is where we are going to define this payload input for the workflow. Okay, saying that we will have two sections on our data filters and I mentioned before, but now.42:34It's more clear. We can filter and either.42:54What exactly from the data we are passing, we want to receive or which specific data from all of the data that we manipulate into the action can we want to pass to the next state, ok? So we can even narrow the, the data inflow or we.42:58We can reshape what the next state will seem. So that is also very important.43:18Every, every state will have this. We can filter in the input and we can filter in the output. What is the data we need, we want to leave, ok? And of course in the state we'll have different operations that might change the data, that might take.43:26External inputs to manipulate something but in general everything is data, right? And we can reshape what enters or we also can reshape what we will give to the next one. So we will, we can think these as.43:45What do you need to know for the workflow to execute for the state to execute, what I want to give to the next state? How it's filtering this data and this is very important to know, it's using JQ expression to filter the input and also to filter.44:03The output, to maintain it like clean, right? And now talking a little bit about JQ.44:23Jqe's a query transform language for specifically jason. So you will feed it JSON, give it an expression and it will give back a JSON as well. The expression what we'll do is.44:33Will execute a filtering or will execute an operation or a condition, right? In order to have something back. And here I wanted to put four examples that are some of the most utilized within, workflow manager and we will see this a lot.44:52Yeah, ok. So in the context of CWM, every time we see this specific sign, dollar signed plus curly brackets, I want that now within JQ, ok? Every time we see dollar signed curly brackets, oh JQ, David tell me.45:09Remember about JQ. So this will be happening a lot in workflow manager. We will see example in a moment. For now just keep it, keep it like this, ok? So the 1st value, if we want to read any specific value.45:30Eh, we will have it in this way. 1 s, we will have it exactly like that.and then the name of the variable.45:47And then it will be something like this, right? In CWM will be dollar sign call you bracket.the name of the variable. And for this one, if you want to practice.46:03Let me show you because JQ has this play play interface where you can practice this playground if you want to understand and also it's worth it for you in the moment of developing if you want to make exact filtering and you want to practice this filtering, you can use this.46:18Playground or you can also install it in the in the CLI if you feel more comfortable, I feel nice this one because.46:39The way I'm receiving information is very graphical, so for me this one was was perfect. So in this example that we see.device name, right? And we will provide a specific jason. So my my Jason will have this specific film.46:46Device name with a value assigned to it and how we are going to refer in a JQ will be.device name. Remember that the dollar assign and curly brackets, it's only two CWM.47:06To tell them that, hey, now i'm using JQ, ok? But in fact, this is the only JQ operation, this one without of the curly brackets in here. When we move to CWM, we will need dollar sign.47:19And curly brackets. So this is the 1st one referring to any specific value from this expression, then let's say if we want to build an specific string and this is very used especially when we want to, I don't know, iterate something and.47:34We want to build, let's say the request to a, to an API, right? We need to build the path. And this one is not more than a string, right? So we need to manipulate that string. We will do that, we will do it in this way. I will put it here.47:54The JQ and I will put here what is the input, right? So let's say, I have my input that will be the ID zero, device name, this device name. And I want to create loopback plus it will be like this.48:12Patient marks plus.48:32Parentheses and we define the specific value we want to integrate and this bar plus two string, we are just changing to the string mode, right? So like that will be compatible. So this is we are manipulating the data and we are passing the ID and joining together to the loopback.48:35Of this part is clear. So here we define a JSON that normally this Json is the data that will pass state by state and this will be kind of the filters that we want to manipulate and to take from previous states, right?48:54Okay, so now let's say if I want to include a new object into this data, let's say I want to add a new next object within my JSON, how can we do that? For this specific thing, I will need only.49:12To put the.plus and then the value that I want to add to my data. In this case I have ID, device name, and the output. Once I added a new object will be specifically this one, ok?49:30And we mentioned that also you can test some conditions and this one will be very useful especially when we are using the switch, mode. So let's say if based on the previous state, I want to make a decision on what to do now, I will need a condition, right? So this.49:47The condition is specified in JQ.50:07How we are going to do that. Now let's say I want to, to compare the job status. So what happened before, if, this one is true, it will give me.50:11The output will be true, right? So based on that, I can make a decision in the switch, but if succeeded, let's say it's failed or of course because we'll be different that job status, then the result of this condition will be false, and we can start making some more logic.50:28According to that. So now having clear, having clear all of these concepts, let me go to a workflow to, to see how it looks.50:48A switch condition for this one we have this switch logic demo, and in this case, it's only.51:09This part. So here we are starting, so this is the beginning of, of, of operation, nothing more. So it's just telling the workflow, ok, I'm starting here. And then I have a switch. This switch, we are configuring here, so here we are.51:24Defining the different elements, what it's important for us is the part of the conditions, right? So in the conditions, I'm defining all of the different conditions that I have. Initially I need to define a default condition, so.51:42If I don't have this one or that one or in case something is chosen I want to define also this specific scenario, the default scenario, and in this case I'm just saying you need to go to this tag.51:58Parallel branch by default, but now if I want to check what the specific conditions I will come here, so the 1st one will be called true, that is this one and I'm just saying from the variable job status remember in CWM.52:14All of the part of the JQ will be defined dollar sign and curly brackets. So here I'm saying to this specific variable, if it's equal to succeed, then it will go to this through. If this meets this part, it will go to this through, ok? And then you can start adding more.52:32Actions or more states accordingly. Then 2nd condition will be named false, that is this one that we have in the middle. If the job status it's equal to failed.52:53Then you will go to this branch, right? Transition next date, and it's connected to the act two in this case, ok? So it's very simple how we are defining those switch conditions. Remember, dollar signed curly brackets and we have a JQ.53:07New expression. That can be conditioned or can be data manipulation.53:27What else we have in here? We also can do parallel executions. That is something that I was mentioning before. In case we want to execute different branches that contain different actions, we can also define it, ok? And for this section.53:32And we can see how to define parallel execution and we go to branches. In these branches, we can add more branches. So in this case I have only two as you see branch zero one is just defining the branch and we can put more actions underneath.53:52Or we have branch two. If we want to include another one, there is a plus button here, right? And it will be defined at the bottom, so here I can put branch three, for instance, branch zero three, and then I save and you see how it is added.54:10In here. I didn't put anything below, so that's why it's telling me that it's it's it's not read root because it needs at least one action.54:30So I could just copy from here, let's say duplicate and I can move it there and then it will be good. But at the moment I just want to keep it with two, with two branches, so let me remove this one and save, ok? So keep again with two.54:41So this is the very basic workflow. I have this condition through or false. If it's true, it will go to act one. If it's false, it will go to act two operation and even every time anyway, it doesn't matter what was this condition, we'll execute the default part.55:00With a parallel execution. I hope it's not so complex, but it's very simple. Let's run it.55:20And let's see how it is working. In this case, I don't have any form assigned to this, to this specific workflow, so I need to put my input data in here in a JSON format. So what it was requested was job status. This is the one that will give me the condition.55:28If it succeeded or if it's failed, it will take different parts, right? And here I'm just adding some parameter random, right? Just for to see how at the end I will receive it back as well because I didn't remove it. So let's run it.55:48And ok it's completed. You also can click directly here once it's executed and it will bring you directly without of going to jobs and select, so that's also a circuit.56:04And we want to see here inputs. We said that if it was succeeded and true, it's going to go to the path act one, right? And we see that this variable persisted and it's the same data that we receive at the end. So here we are.56:20We are validating two different concepts, how we can create JQ expressions and create conditions on how the data is flowing. If you don't remove, if you don't filter, you will receive information at the end in this data.56:40Data json, right? We can go again to my workflows just to, to put now with the failed condition to see how now it's changing. And oh by the way, here what he's doing.56:58It's changing the data filters, it's adding this path act one. It's adding a new object in my data data data data object, right? So here we are adding this act one that is the one that we just saw.57:13And here, it's adding the act tone that is the one that we are testing. Now, let's let's test, we put the input data. Now I will populate failed and demo value, this is just random information to see how in the end of the workflow will retrieve us the same.57:30Okay, I will take the shortcut and I will see the outputs. Now the input data was failed, so my condition went to the other side, to the path number two, and I see here now how it was added this new object to my data with the act two that it was exactly.57:50Exactly what I wanted.58:10To do, right? So we check with this specific part, three different things, we check them how to add a new a new object, how to create the condition and how the switch and the parallel are working in this.58:12Eh.58:32A specific workflow. Any questions at this point? Let me check the chat and yeah there have been a couple of questions. I think I managed to answer them. They were mainly related to how do.58:33You pass data between states, and you read that one and you already explained it. And then there is another question which is asking if this would work if a workflow automation would work with 3rd party devices and I was just about to answer it.58:53Yeah, if you want to take that one, if not I can I can answer it. Ok. I I see that also are asking about the workflow. Yes, I wanted to share at the end, but I will put it now. I created just a GitHub repository where I put the scenarios.59:11That are used during this during this presentation, so if you want to take a look, I, I just paste it here in the chat. And what was the other question? If if workload automation supports 3rd party products?59:28Yeah yes yes yes, it does support 3rd party products. You have you mean you mean if it's for the adapters, you can basically connect to any API.59:45Available, definitely. You have this open API adapter that we will talk in a moment about it and you can integrate different, different other systems for sure. Even from the northbound. You have NO northbound APIs and you can connect and you can create your scripts if you want.01:00:01Want to do it as well. That is possible. Yeah.01:00:21Yeah, and just to add if, if we think about the previous session where we looked at out of the box solutions like fleet upgrade, e.g.. So that has been tested with Juniper MX 969960. At this point in time doesn't mean it cannot be adapted to, you know.01:00:24Other, models in the juniper line or Huawei or Nokia. The way that works is because it's very very difficult for us as Cisco to you know test for all devices that are out there that requires access and so on.01:00:44So the way it works is it's a collaboration between you as the customer and our business business unit. There is, this is part of of the services agreement as well, the, the services contract, and it requires access to a box on site.01:01:04And then work can be done together to create or adapt adapt the the workflow. In future version we'll continue to add based on this type of collaboration that we have with different with different customers. But if you have like specific, you know, requirements, then that's a good moment to engage with the.01:01:24The Cisco you know account team or the services, the delivery team that the CX team that works with you directly and share that information and ask.01:01:44Thank you. Thank you for that. Okay, I have other, other quick, quick example of workflow and how the data is being transformed that to me it's a concept that once I understood.01:01:58How it worked, it was much easier to follow the different workflows. So in this case, I want the the objective of this small workflow is just to build, let's say an NSO query, a query to other system.01:02:14Based on a specific input, I want to create an specific output, right? For this, for this query. So let's explore a little bit here. I have a state data filters. So I want to ask.01:02:31And this specific this specific object to my data and that's why we have the.plus, which means that I want to add new object to my data. This is the object I want to add just called for each, nothing, nothing connected with.01:02:49A loop just for each and this is my specific path I'm building, but I want that it will paste in this specific part.01:03:09So it will concatenate the string with the name of the customer that it will pass in the beginning, ok? So I hope that is, that is clear, and then here I have another action that it will manipulate the output in this case.01:03:20And it will just add another one. So in the 1st one I'm adding for each and in the 3rd, in the last one it will add this message object with, again, the customer name, ok? And I will pass this as a variable.01:03:36So let's, it's very simple. I will I will run it. The input and what it was asking me is to add the variable of customer name. Again, I'm I'm referring again. I'm not connecting a form at this point. I'm just putting the data directly in Jason format. Okay.01:03:52So it's customer name. This will be my customer name. Let's put a different customer name. It will be called the bit the bit tech.01:04:12Oh, like this will be my customer name and I will run it directly. So I run it and what we will have to do just to remember in the 1st state, it will add the specific for each part in my object, and in 2nd one.01:04:23What it will add, it will add the message part in my data, ok? So let's see what retrieves me back em.01:04:43Completed this one and we will check only the outputs results. So this is what I entered the customer name and see in this part how it was updated the specific string, the path that it retrieved me. I just put the customer name.01:04:56And it added this for each with a specific path and it was included here the name of my customer David Tech tech, automatically in this filter formatting. And then 2nd state was adding the message to my data, to my data object, right? And.01:05:14As well adding the customer name, David Tech in the specific section that I put it. So this is just to conclude this part of how the data can be transformed and can be modified and also we can create conditions using the JQ in our workflows.01:05:34Okay, I hope that part is clear, and let me put you here in the chat one interesting link that might be useful as well in this section. What is this? It's only the serverless workflow GitHub, so if you want to check some of the details.01:05:55And also I put the JQ playground in the JQ manual if you want to to explore this topic further. Ok.01:06:14Now, it checks itself CWM, what it means with that, we can create data input schemas that will help us to validate the data we are entering before it's running or it's failing.01:06:25In another step step, right?01:06:45What can we do with this and we can, e.g., create some sort of patterns if I want that only for a specific section will follow a pattern. We can define this pattern with regex in this case, e.g., the device name.01:06:48Needs to be the type string and needs to have this specific pattern to follow, right? We can make this definition. Let's say also if I want.01:07:08To my loopback ID will be within a specific range, we can also do it. It's not checking against the application, it's just checking the value itself against the pattern or the range in case that we are defining. It's you.01:07:20In regex or we can also define a range of numbers eh et cetera, right? But it's possible to create that validation. And It's also when we are creating the forms and I will explore in a moment this piece.01:07:40In the forms you can also create this validation of data. So at the moment you are filling up your form, you can check, ok, you write wrongly this, it has to be string and not integral or or stuff like that within a range or something. That's also possible to validate and to associate with any specific.01:07:56Form. So putting a human in the loop is how we are creating the forms, right? If in case we want to have receive an approval or in case we want to put some information in a different step or so on, that is also possible to do it in CWM. It can collect the.01:08:16Different fields and again using this regex validation, it can select from multiple lists. We can also use checkboxes and different things and the pause is very important because CWM will handle this pause. It will wait until receives this event.01:08:36Callback, right? And it can continue with the workflow without of any problem. So it can handle this status. And I was mentioning in the beginning in scripts, in a normal scripts, it's, it's very hard to control these kind of things, right? Probably you can do it, but you cannot keep the process running all the time, but CWM can.01:08:56Handle this workflow once received receive the trigger of the event and proceed with the rest of the step, the steps, right? So for this part, how it works, let me go to the CWM and for here I will show.01:09:16Workflows, I have the workflow multi select, I just name it like this. And what can we have here? In this case, and this scenario, it's it will.01:09:38In this specific scenario, it's let's say we want to perform a change in a specific VPN endpoint, right? We want to modify, so it will tell us what, which, customer we want, what are.01:09:55What's the endpoint and what is the specific change we want to perform in that, in that matters. So it will do like this and it will all give us a form where we can, activate or where we can make some changes that we defined. So in this case, it will start the.01:10:14Workflow is not more than this, the beginning of this workflow. I don't have any data filter and I don't have anything. It's just saying this is my state to start. Then I am having preparing endpoints. In this case, I have those endpoints fixed, but it.01:10:35This will be in real scenario. You can replace these prepared endpoints but a API call to a specific device or to check any other system, but in this case I'm having it fixed. Why I'm preparing those endpoints? Because those endpoints then will be used for the form at the moment of.01:10:55Lighting them the things, right? So here it's just preparing the endpoints and NO filters. And then in 2nd one, and the 3rd one, I am associating this callback state to a form.01:11:16What is going to do, I need to predefine the form. I will show you in a moment where to go there and I will give a task name. In this task name within the text gaps in CWM I can also use JQ. So in this case, I am referring to a specific variable.01:11:31When the task will be created to populate the form, it will follow this name, right? And here, I'm just adding all of the data. This dollar currently with a.means I'm passing everything. All of the data I have, I'm passing, so all of the data file containing the n.01:11:51Points and containing the customer name will be passed to this specific operation that is the callback state. Then here I have other, other state execution timeout if this we want to add and that's it. Once it receives, if the form it's approved, here it's a condition.01:12:11Right, if this is approved, it will come back here and it will execute whatever. In this case, it's just a NO operation, but for for the matters of the, of the demo, right? But if that will be a real scenario in here will be an action to trigger this specific function, right? To, to make the change.01:12:31Which can be through NSO, can be directly to them, to the device or or depending, right? But in this case, it's just.01:12:51To to show this part. Before I execute this, I want to show the part of the forms. Here we have the section of forms and here we can define the forms. Here I have, this is the one that we are going to utilize. Let me see what it was. This one.01:12:59So here we have this designer of the forms or that we can utilize, and it's very simple. We have forms, we can add more drag and drop and then configuring, let's say if I want to configure the customer name, input, here we.01:13:17Have different elements, I will not go through all of them just for you to know that this exists, but here we can modify these parts. Let's say for the endpoints we have the multi.01:13:37The multi selection that is added here yes choices, JS and the data as well, right? So here we can modify as well in this part. Here is two options that this is predefined.01:13:50So let's say in the data, we can predefine the list that will be appearing in the in the dropdown menu, but it's just for you to know that you can come here and you can create your forms and define them accordingly. Here you also have this part or the label.01:14:07And how everything will be retrieved, right? You can save these forms in Jason and you also can, so that that is also useful in case you want to.01:14:27Modify or you want to create another one, so just save the JSON file and that is, that is useful for you to keep track of it. Okay, so let's execute that part multi select. Let's run it for this one, we need to add, I believe only the customer list.01:14:44Any copy from my.01:15:04Okay, and then I will run the job. In this case I will go and it's something important because remember that there is a callback. So it means the workflow stops for a moment and it says keep running, right? That normally.01:15:09That'll be that something is happening and and but in this case because we have the callback, we will go to tasks. It was created this task and here it will create that service for according to how we define the name of the task. In this case, the customer was CX global just something random.01:15:29And we click and we'll open this specific form. So in this specific form, we put the name of the customer.01:15:49According to what we define, right? The endpoints, those are the ones that we passed through the CWM definition, right? That we said that this could be replaced with an API request or something like this. So those were the ones that were passed in the workflow. So we select just one.01:16:00One and here we can choose one of the options that we define in the form, right? Eh, so here important we need to click approve and apply changes in order.01:16:20To the workflow to be successful. That was one of the of the pieces there. So I will just click and I will submit changes. So now it's good. I can go to the jobs and see how now this job has been finished. And I see that the result now I.01:16:31Just manipulating data, of course. The source was the data endpoints that were the ones that we passed to the form. Those were before we go to the callback, then this is the customer name, the one that we started with, and then here we have the form output. What we retrieve from the form.01:16:51The population, right? So it's approved. Yeah, this, it was the checkbox approved. Yes. We have the customer name written there as well.01:17:11The policy that we selected and the endpoints that we also select in there. So in this case, this is how we can associate callbacks and forms, right? For any specific workflow definition that we want to, to do.01:17:21Okay, so let's go to the next one. We are almost on top of the hour hour, but I want us to show this part, going to how it can reach real systems. And as I mentioned, we have those adapters.01:17:41We have adapters that are out of the box, meaning that you can install them directly when you install the CWM in the software.cisco.com and there is a folder and you can download the adapters and install them locally. And you also have the software developer.01:17:59Your kit in case you want to create a custom custom adapter.01:18:19So how it looks this adding an adapter, it's very simple eh basically you will have a zip file. I have them here, e.g..01:18:26And Install medium and then I have them here in adapters. You will have something like this, right? When you, when you when you download the files from, from the installation of CWM, they will come in this folder and you will have those out of the box. So CLI.01:18:41Databases and email, right? And it's a zip file. So if you have this sorry tar file, you can come to administration, workflow administration, and you have any specific section for adapters. In adapters, you can come and you can.01:18:59Add the adapter.01:19:19And just will ask you to, to upload them. In this case I already have the adapters installed but you select the tar and it will automatically, include them and it will create a worker by default, right? So in this case I have all of them.01:19:20Eh, once you have the adapter, you need to create and remember the 1st part four different elements adapters, resources, and secrets, and workflow worker, sorry. So the worker is created automatically once you install the adapter. But if you want to make some modifications.01:19:41I believe it also allows you to do it.01:20:01Then the resources is where you are going to define the host name to your system, the port and so on. So you will need to define one resources per each instance of adapter you want to connect to. And then you have here the secrets, right? I don't want to show them, but here.01:20:04I think they don't show, but so for again for every resources you need to create the secrets where you will store them different parts.01:20:24And ok let's go to show quickly this part of my, of my, how we can do it. In this case I am enabling NSO, NSO adapter, which means that I will be able to connect to, to NSO.01:20:34So and make some changes or perform some modifications and at the end I also have the adapter for Webex notification and in this Webex notification, we can all also.01:20:54Send messages accordingly. Just let me open my Webex notification so we can see how it receives the model, right? So in this case, let me put it aside taking too much space.01:21:11Okay, it's evaluating firstly if we can, for the change of the loopback interface, it's firstly checking if it's in sync in my NSO and based on the answer of this one, if it's not in sync, it will just automatically retrieve that message.01:21:31If it's in syncs, then it will build the payload and it will configure that specific loopback that I'm, that I want to do it, ok? So it's, it's very, very simple.01:21:50And let's go to do it. So let me execute it. We will see, we will run it. In this case I need to add my information here in the, in the input, I don't have any form associated just for us to know.01:22:04I will just choose the device name, this device name, I'm just talking directly to NSO, I'm not talking to the devices I have onboarded in CNC, ok? I want to be clear on this. And I have I want to install this loopback ID with this specific description.01:22:24Demo, let's change this for 104 and here I'm just putting the room ID of of this Webex conversation I have. So I will run this and as you see now I just received 1130 and actually we are on top of the hour, the message.01:22:42That has been provisioned and.01:23:01This eh, specific device and that specific interface. So in this way is how we can connect to an external external systems. In this case we could connect to NSO and we could connect to Webex as well for.01:23:05Or different things. Something worth it to mention at this point.01:23:24You can also build your own adapters. You don't have to all the time. Firstly, let's test if the ones that are out of the box are possible to use for you or if you can reuse some other elements. If you want to build something very specific, then we have available the SDK.01:23:30Okay, and just to mention this Webex adapter was built with the SDK for, for practice, right? To test this, this, this scenario, it's using go language and, and yeah, nothing, everything is provided in the in the documentations and in the SDK.01:23:49They once you download the the installation files of CWM, you need to specify worker and the operations at the moment of calling them.01:24:09From the, from the functions in your workflow and you also need to refer to, the specific part, right? So the metadata of the worker, you need to specify to which adapter you want to use. So I didn't show this part in the.01:24:21In the workflow, but you have the link.01:24:41To my GitHub repository, so you can explore how this specific workflow was built and what are the different pieces, ok? So just wrapping up, we build it once and we can, we can reuse, so we see this part of the monolith that is how we can.01:24:45And work build or workflow in one only file.01:25:05But we can also create a small mop actions, right? And it's how it's moving in this way. So each each mop we can divide it into small actions, right? In order to build all of these things. Once we have our mop, the method of procedure in this case.01:25:09We also can order the different small actions into different stages.01:25:29That is also possible. Rasman was showing this element, this part in the previous session, and this is how it's built the solution or the applications that we saw, the fleet upgrade, the golden config, or if we want to build custom applications, those workflows that we saw today, it's.01:25:34Exactly how those application solutions are.01:25:54Are are built, right? So in case we understand the concepts, we understand how they are built and we can make the best use of them in that case, right? And what we saw today, just to remember, we check what is the workflow in this CWM context, we saw.01:25:59How the data was moving and how we can use JQ to check and to create conditions. We also validate how to talk to real systems to different external systems and we understood that the applications, the solutions that we saw previous session.01:26:19Are exactly built in this way, ok? So we have a better understanding and we can see exactly what we have. Okay, thank you very much for for your attention. If you have any questions please you can let me know now.01:26:37The next session, the next week we have the last session of this series, we will talk a bit more about CWM in real world, right? More a practical example probably will be a bit shorter that session. But yeah, so you can have here the link for registering. Also you can.01:26:53You have the links in the, in the chat for the community pages. Let me put quickly anothers and just I want to remember I want to remind you, you will have a survey at the end of the session.01:27:14Please, please put there your your feedback. It's very important for us to, to understand how you feel the value of this and when we invest this time with you and we appreciate your feedback. That would be super helpful for us. I also put now some links, so feel free to copy them and save them in your notes.01:27:34Or something that I consider will be useful for you together with the GitHub of the workflows that we were looking at today. Again, my name is David Kissala. If you have any question, please reach out to me. Thank you very much for your attention and see you next week.01:27:54

About this Video

Author : Cisco Customer Success

Uploaded : September 18, 2026

Data CenterApplication Centric Infrastructure
AI summary icon

AI summary

The recording demonstrates how Cisco Crosswork Workflow Manager enables engineers to design durable, state-driven workflows that automate complex method of procedure tasks. It contrasts Cisco Workflow Automation in Cisco Crosswork Network Controller with the standalone deployment, then builds hands-on examples using the Serverless Workflow specification in JSON: inject, switch conditions, parallel branches, subflows, loops, and scheduling. The session shows JQ-based data filtering to pass, reshape, and validate payloads with JSON schemas and ISO 8601 timeouts. It introduces adapters, workers, resources, and secrets, and connects workflows to external systems, including Cisco Network Services Orchestrator for device changes and Webex for notifications, as well as open API integrations and the SDK for custom adapters. The demo adds human-in-the-loop forms with regex validation and callback tasks, and traces jobs, tasks, and event history. It turns robust, out-of-the-box capabilities into reusable building blocks for repeatable, resilient automation.

  • Build and deploy durable workflows in Workflow Automation to execute MOPs consistently.
  • Integrate with NSO and third-party APIs using adapters, resources, and secrets.
  • Validate and control data flow with JQ filters, JSON schemas, forms, and callbacks.