---
title: "Live stream🔴 Multi stack content type sync using Automate"
description: "Live stream🔴 Multi stack content type sync using Automate"
date: "2024-12-11T05:08:08.000Z"
url: "https://timbenniks.dev/videos/live-contentstack/010-bhzrts_x9yu"
youtube_url: "https://www.youtube.com/watch?v=bHzRtS_x9yU"
playlist: "live-contentstack"
duration: "1:02:27"
image: "https://img.youtube.com/vi/bHzRtS_x9yU/maxresdefault.jpg"
tags: ["composable-architecture", "cms", "api-design", "cloud-infra", "frontend"]
---

# Live stream🔴 Multi stack content type sync using Automate

Live stream🔴 Multi stack content type sync using Automate

Watch on YouTube: https://www.youtube.com/watch?v=bHzRtS_x9yU

## Transcript

[Music] I didn't know yet that I had to click like 14 times to remove the intro and then put us on the screen I think I need to have a key binding or something was like click click click and actually this this is our first live stream and so of course everything had to go wrong I just clicked go live and you know what it told me Twitter needs a premium account so we just will not stream to Twitter now anyways it is what it is any anyways um welcome everybody we are now live with our first um pulse for Developers for Content stack and so this is going to be a whole lot of fun we're going to be live streaming a bunch for all the tech folks out there that want to learn will be learning we'll be showing of cool stuff and so um with me we have loow and Ashish and I'll let them introduce themselves first so loow how about you go first sure so I'm low everyone I use they them pronouns I'm this senior technical product marketing manager here at content stack um I've been doing front-end engineering for a while and also have been a devil developer relations specialist for a number of years um I love all things CMS all things CMS that's the go all right Ashish hi everyone my name is Ashish tiwari I'm a senior solution architect at contentstack I'm working with contentstack since last four years my major role is to do a architecture Consulting and integration and content modeling related uh assistance to the customer Prospect and partners so yeah here I am all right and so you're G to show us some cool stuff right yeah y yeah because we work with a lot of our partners and um our customers and then there's all these really cool things that our platform can do that sometimes well they're pretty obvious but you don't fully know if it fits your use case and so we have people like AIS building like the coolest stuff that we didn't think you could actually build with our platform and you can and so Ashish is today going to show you one of those things and so basically well I'll let is she really explain it but in short if the bigger your company gets the more control you want to have over data models right and you might want to have multiple stacks and multiple projects that kind of understand one data model so when you want do one change it kind of just changes everywhere and so that's super important for governance and so that's like the shortest I could make this so asish why don't you take it and explain a bit more and then we'll share your screen and you can just go for it basically yeah yeah sure thanks King so let me just go to a document here so the use case here is about think about you have uh multiple Brands and you want to set up a Content management system across those Brands uh those brands have a different set of content different images different brand different colors combination and all one thing which is common across these brands are uh layout the templating part so if I take an example here you can see here I have this particular website I just a simple website for Dem purpose so I have the fashion uh brand it's talking about style the speaks and I have a h and menu same layout if I go to a tech startup different content different logo and the same set of layout but the content is different I have a different menu items here so now I want to manage these kind of website uh in content stack so what our customer do they create different Stacks so when I talk about a stack stack is a kind of like a a inside a Contex like organization you can create multiple stack to make a segregation of content in case you have a different team working on it you can give them a different uh access to it like a specific team is working only for a tech related content a specific team is working on a brand specific content and all so for those kind of scenario people create different stacks for it so uh that's overall and now let's get into a a a problem statement here so if I have a different brands and those are sharing the same uh content types so it's content model also we call it content time is nothing but a schema uh whenever you create a Content first of all you need to create a schema according to your page layout when you receive a uh designs from your designers based on you if you have a banner if you have a author details or something like that B on your page design you create a schema that's something is called as content types so in our scenario we will have multiple websites but all of these websit will have the same content types templates but the cont is different and images and color combination will be different right now let's think about there is a new requirement came and I had a Blog Page uh I want to add a new Banner to it earlier was there was no Banner now design told me like you need to have a banner over there what I'll do I'll go to the content model and add a new field in it so if I take an example of so I need to add a banner here because you can see here there's no Banner so it doesn't look good right yeah so keep that mind I want to add a banner here so if I need to do that if I have a 10 different brands or let's say some customer has 100 brands or 50 Brands I need to make that change going to each and every stack if you see my stack screen here if I go here on my organization I have this uh this this brand one stack two three four five so all of these are having the same content type if I need to make a change in content dive or add a new content dive or delete a Content dive I need to go into each stag need to make that change and it will be a time toce along with that there is one more scenario when you make a change in content model content model change is not a small change because you if you're making a schema change will also impact your entries so if you're deleting a field that means you need to delete the data of that entry or a page also across your different uh you can see a real example is brand website one brand website two I have 10 content types but we talk about entries I have 230 yeah this is just test one but customer will have like millions of Entry sometime so even to check and perform those operation and making sure after a Content model whatever the changes you have done if you have deleted a field you need to make sure that F data is deleted across your pages also because that's something is uh getting pulled via apis so again that's a bit of like a Time TDS job to do it manually or if you write a script again it will take a lot of time so now uh for these kind of architecture what we recommend and what our customer has done in past a big Enterprise customer so let me just go back here I can create a global stack and I make sure like a a specific users or a a team leader of a development is having only having the access to that Global stack and This Global stack will have same set of content types which are here so this is a single source of truth I just go and make the content type changes here and it should automatically propagate to all of my website I don't need to go into like 10 or 20 website each and every time so this kind of solution we are looking for here quick question s to interrupt how does that work with like authentication and stuff because could it be that one content like one admin that's maybe like an architect could run this automation or whatever we're going to do to make that work what if they're not allowed to do that in a certain step how does that work yeah so for that what we can do is uh whenever these sites and all we have a different set of uh user roles what we can do is uh we will not give a developer uh role to the users who are working on here if they will have only content manager and content editors with content manager and content editor you will not have access to content model so they are only allowed to make the changes on entries assets and everything they are not allowed to make the changes to content models so there is no way somebody going into site one and make uh content model changes yeah the only way is you go here whoever is having access to this particular stack they go to the global stack they make the changes and that changes will propagate to all the brands so I think like I imagine that this kind of solution really helps with governance right so the whole point of this is you can sort of quarantine off the data between these sites while also taking advantage of the composability of like content models right if the content models need are the same for all the different entities there's no reason one to increase error right because that's part of that the more you repeat these kind of changes to a Content model that everyone's using the more likelihood there is for mistakes versus having all the content models live in one Global stack and just populating all of the entities imagine if you have 20 Stacks you go in yeah you keep clicking yeah me as like an old score developer I would do that man I've seen customer doing it like for 50 St what they do they go to a one stack export it other content type and then import it again again it's it's kind of like even if you're doing that clicks and all it is a time taking Ian and and even you're making direct changes so you don't know after you're making a change to your brand website uh your production might uh not have the data suddenly uh so keeping that in mind it should be like a if this is a big uh the schema changes is a big thing in in the content management itself exactly so we want to make sure nobody else is having access if it is happening it should be happening in a proper streamline process and uh whatever the action need to be performed after that like an entries and all that is also we you can write a logic and uh do that particular stuff also which we will see in a moment yeah so how do we then solve this right and that's that's probably the next step I'm sure you're gonna get there but what I want to highlight once you show this stuff and of course we know because we prepped this um this is not a proprietary thing that's specific to content stack that where we build like a feature for this this is actually using a composable tool that we also offer and therefore you could also do that same thing for other systems and that makes this of course very interesting in our composable world so I think I said all my bus words now let's go yeah so yeah so just to start with that we were talking about the manual step so if we are talking about the manual what you want to do you want to automate somebody else should do for you right so as the name say automate we are going to do that so we have a product in content St called automate that particular uh product is for uh trigger an action based workflow Builder So based on certain triggers happening on your Global stack there are certain actions are perform across your different child stack right and that is also happening in a streamline process you can have a step by step okay after this particular step after content type is is created or updated or deleted what are the things need to be done so you can have a sequential flow of it and the things will happen in that it's more of like orchestration of whole thing itself right uh so before I go into the detail let's see a live demo of it first yeah I would say show the magic then we talk yep okay cool so let's go back here I have three content types across these five different brands let me just create a new uh content type here in the master stack I'm going here I have blog news page I can create a new content type you can name it anything uh let's say article yeah and I can keep multiple here save once I hit the save let's go back to the here there's a four content types and you can see the magic here these brands also has the four content types did it already run yeah it's done I mean it's hard amazing just one second can you make another one I don't believe you yeah let me just do it I'll just create a new content model here saying okay uh I'll call it as a uh homepage it's a single let's keep it single yeah sa go back here it's fine okay this is just a create part of it yes cre a model and now well can you just click in brand one and look at the content types yep you can see whatever have there we go awesome and articles are there it's just done 943 I mean it hardly took a second I mean less than a second I mean yeah and quickly can you explain the difference between Type multiple and type single as well yep yeah sure so type multiple is something when you have a Content model where you want to create only single page so the best example is homepage you don't want to have multiple homepage right every website has single homepage so that is something you can creit as a single one but if we talk about a Blog and article because you don't want to create single article or blog in that scenario what we will do will Market as a multiple so you can create a multiple entities in that particular cont this is what the simple awesome excellent sorry continue yeah so we have done the create part now let's see the magic happening on the update time what will happen so if I go here on the master tack uh again here and let's make a change to the homepage one here this is just a title I want to have a bannner image of for for my homepage and I can have a Content fill here and if I hit the save that means I'm updating now let's go back I mean on my stacks there's no change because we have just done the update I'm going to Brand one stack going to that particular homepage entry here and uh let me it's it's might be running here because it's update one so I can see here in the automate it's running over here oh we're going um be under the hoot now yeah so let's go back here on B stack and you'll see oh there it is nice it's coming on here if I go to the brand two stack and just to verify uh Es are reflecting here this is like update is happening in a real time basis across all your Brands okay now the last thing is delete create update delete these are the three action we do it so let's go back to the master stack so before you delete can you have a look at this question from Joy so would it also be possible to do different stack synchronizations per content types yep yeah you can do it I mean so you can I I'll go into deep into that like if you have a 20 different brands stack you can configure how many stacks you want this synchronization to be running I mean so that you can control it if I understand yeah so do you have that in your demo later on or do we if we have time should we just try and do that uh you mean uh the configuration of the different Stacks I mean uh well let's let's continue on how we have it now and then if we find some time we might dive in because that's a very interesting question for sure and one other thing great going aish from somebody Anonymous but we take it right yes yeah right um did you want to show the delete still yep let's go back here and I go to the Master Tag and let's go content models which one we should delete so let's delete the last one homepage I the homepage so I just do the delete here delete is happening it's four here uh if I go here and let me just go here it takes a seconds and let's see if it actually ran behind the scenes already not yet while we wait we have another cool question from Eric so I love Eric's Icon by the way I know it's amazing by the way um can we specify that a content type Belongs to Only certain brands oh that's an interesting one yep so what we can do is uh that that's a really good question I mean we have Sol where you have a same set of content types but in some scenarios let's say you have a 10 different brands but in that uh only two brands or three brands are there where you have a news article right in that scenario what you can do is uh you can definitely check in your automate checking if that particular content type exist then you make the changes if it is not then do nothing Ian so that kind of like a conditional thing you can yeah we have like if eles and stuff right in I think we're going to show that in second yeah because I'm like let's get into the automate configuration well we're here anyways right so you're looking at your how that works so let's just just have a look at what like can you give us one sentence to pitch automate and I know of course Christine RPM will probably be looking at this and seeing can I she actually pitch my product in one sentence can you give it a go yeah so automate is something I mean makes your life easy I would say this is the simple thing uh that it saves a lot of time efficiency you can um put your brain and time in doing some cool stuff and whatever the repetitive task are there just leave it up to automate it's just a onetime configuration and a bot is running behind the scene and doing your stuff something like that exactly make your life I like to call it auto magic yeah that's amazing I mean auto magic I mean that every time something is happening it's magical so so yeah Christmas is coming so Magic Christmas is coming why don't we unpack the magic though and actually go in and see yep sure so let me just go into uh the configuration part here so this is my automate it's very simple it's a five step if you go if you count over the steps it kind of doesn't look very simple though dude yeah like I don't know what I'm looking it yet can we just maybe click on the first one and talk about what that actually is yep sure so uh if I click on this the content type trigger so as I mentioned the automate is all about trigger and action so first thing is about trigger uh automation is always listening for a trigger uh any event and all so you need to make sure like you set up your event uh uh based on your use case itself so for our use case what we want is a content type trigger so we have a connector um again it's not something you need to set up a Web book or something like uh uh a a logic behind it we have a Content management yeah which will always give you the all option like even if it is entry trigger workflow Trigger or content type trigger for our use we are going to go deep into content type trigger and so sorry to interrupt but like just to give this a little bit more clear for others as well so we have a bunch of different types of trigger we can listen to and so it could be a web hop from another system like I updated a YouTube video and it sends me a PPS up whatever but we also connect it to a stack and therefore we get all the native content stack things that can happen that you can listen to right yep yep so Co for this particular use case we are looking for Content St but if I just click on here there are like different options so as you mentioned the PB ah yeah here we go HTP here you can put your webbook URLs here so anytime a third party application is performing any operation this automation will be notified and the next magic will start happening I behind the even one more thing which is very powerful sometime you don't want to do it's more of like real time you want to schedule a time so that scenario we have a scheder so you can schedule it saying okay once in a day once in a month or something like that so thing yeah so coming back here I choose content St management and then you can see different uh options here there's a workflow trigger Global field entry trigger for use case I'm just using the content type trigger and then this is a magical part so we want to make sure this is a big operation uh you're making a change in content management we have audit logs we want to make sure nobody else uh there should be proper authorization should be happening so we have the functionalities in contest that is again it's very simless I mean we have all the options available here simply select here if I just give you an example I add a new account here and these are like the permission I mean what when you running this particular automation what are the permission you want so there are a lot of permission for our use case I just simply want this so I can simply remove all the other one and I can just say I want to perform create update deleted content apps only and it will give me a token authorization token which will only have a scope to whatever we have selected here yeah so just something slightly simpler we have AO between our own systems but also between other system right this is like loging with Facebook and you can only look at my title that's essentially what this is yeah okay cool yeah just I I kind of understand it but sometimes this goes so deep I'm gonna have to just step it back one second but okay this this is cool so this is an actual right because I could imagine doing this with like a management token type of thing that can do everything and therefore if that leaks there's problems and this is an actual all off implementation and of course when you work with for customers like ours on that scale this is like the minimum you have to add in it's actually super solid to have it yeah let me share you good scenario I have used the management token while building this before that I'll tell you the U the this optimization happened behind the scene I think already spoke with you initially I decided okay uh how to get a management token so I thought I have the access if I use my username and password I'll get my authorization token and that I can use to perform that operation again exposing my username and password is not good so I thought bad idea then I thought of a management token now we talk about management token management token is specific to stack so if I have a 20 stack I need to create 20 management tokens and I need to that and I need to use that every time while making change right and even management token if somebody's exposed that management token is exposed they can perform any operation so keep we have I've done that and then I and then I was talking to our awesome automate team I I'll take a name of it Sumit was very good it and I explain and within a day he just said okay let me just uh add this functionality to content app trigger itself and within a day itself he added this feature now I don't want to work I I don't need to work on the management token or uh the user login I just simply authorize it and it will give me a token that is a third party integration token which is uh the recommended way and that I can just simply use it for next operations and all oh that's awesome yeah I love the governance and process of this you know I'm a big process governance only give people what they need to have access to and nothing else yeah we need to practice some of our like um authentication cleanliness is here anyways let let's move on because there's so many steps left yeah so uh then there is a selected event so uh either if you want to keep a if you have a use case only on create then you can just choose that but for our use case I want to make sure this automation should run on create update and delete so I just simply use all event so it will listen to All Event and then you select the stack on which particular stack you want to listen so it's it's G me the list of Stack I want the master stag it should always listen to the master stag uh so that you need to uh very uh Define here the branches it's another topic uh branches is for cicd process and all we can cover it later on in any any other things but yeah I'm just keeping it main as a default branch and I proceed here and there's a cool thing in automate I mean anytime uh you set up a trigger you can always test a trigger because when you test a trigger you get an whole object of what will be the payload of it and that objecta is required for you to perform next operation I mean because if you don't know the key value pair about uh after this trigger what data I'll be receiving then you don't know what to do I so keeping that in mind I just use test trigger it gives me the latest so this is the latest event that happened when you just changed something just now before and that's what this is showing right and honestly when I used this for the first time I didn't understand this could work because when you use tools like sap or your code stuff yourself you constantly have to then go back into your stack do an update and see if stuff comes and hopefully I have a console log somewhere right that's my life imagine this will just look at the latest thing in the queue that we have and show it to you so this is basically the whole model of that latest content model that you changed right yep yep this is something I mean just listen to that event and one thing what data I need from here so as I mentioned here I I selected all event so I want to make sure if if I need to find out which particular event happen is it a create is it update or delete because for each different event I have a different API H uh API to hit uh to make that change right yeah there is a event key value so it will give me this particular key will be used for my conditional like if else and all so that is a good example we going to talk about so this value will be utilized to identify after this trigger uh is it a create update or delete okay and then you can also get the uid of the uh the content type itself so if you need to delete you need to know which particular content type to delete so that you can always use the UI yeah exactly so I just save and exit here and again there are a few more triggers you can also uh set up a condition here saying this automation should run on this particular event only so if I want to make a complex condition saying uh check if it is a create event and if it is for blog content type only so if you want to make a complex condition before I run so you can always use these uh trigger condition you can make and an or operation and make it make sure like the next operation before performing the next operation you make sure you can write a complex uh uh trigger setup so that will be really useful for other use cases but for our use case we don't need we don't need it yet I'm actually pretty excited about your next step because I think you're GNA do some code right yeah so before I I do this now what I want this trigger happened now I want to get a list of Stack where I need to perform this operation so how I how I will identify different Stacks so for that what I'm going to do is there is a cool thing in automate it's a project variables so most of the developers are aware of like you create some variables where you can maintain certain things and all so if I have like the the question earlier if I have a 20 stack and out of 20 stack only 10 Stacks are identical where I want to perform that operation so I can just configure that here I can say child stack one API key the API key is the unique identifier for stack yeah so I have five different stack and I mention these API key now basically just a key value store for any sort of like like environment variables for when you deploy something it's the same thing right so if you add a variable you can add a plint text in case of like sometime when we do a third party integration where you want to store some tokens and all you can always have an option to secret oh with a secret yeah that's interesting so it's it's something like there will be a encryption and decryption will have be happening so just to make sure for our use case this is just a St key so I kept it as a l T so now I have set up a project variables what are the step stack I need to perform different operations now going back here and to perform an operation I want to do that operation across multiple stack when we call multiple I want an array of object but if I go here these are like single values and all it's like a key value PA so I want to get an array of all of all the stack API keys so these kind of scenarios will always come where you need to modify or transform a specific object right so and that particular thing you can use our cool thing like the developers are there I said low code and no code right sometime you don't need to code but sometime you just need to customize a bit right a tiny little bit of code we put a little bit of it in I just have one line of code I mean if I show you here so I just have one line of code what I'm doing is these are my stack API key and I want an uh uh array of values I'm just simply using a JavaScript function saying return objects. Val and what it will give me will give me an array of uh uh array of stacks and these are like five Stacks so I I I'm going to use these API keys to perform that operation the repeat path uh a loop kind of a thing so so this this is something a very cool thing I have done a lot of other uh use cases where I want to write a bit of code to transform even we have another utility which is transform so this same thing can be done using transform also where you don't need to write a code I mean it's it's it's a list code I mean so even I can use that but I wanted to show the JavaScript because you can have a bit of a JavaScript sandbox inside a step of your automation that just is hosted somehow that is gets special inputs and just returns as an output and you get I see you get low Dash as fat as well as fetch even that's pretty cool yeah you can make Fetch and load H and let's say you want to filter an error I mean if you have getting a data and you want to filter it or you want to uh make some conditions and all you can write all those Logics here in a JavaScript and it will execute on that so it's pretty cool I have used in different style this is a very Savior for me I mean in different use cases so yeah that's very cool and so now that you have this the next step is actually I can Al really see you do a loop so can you explain that context of what that is so the loop is something uh there is a if I just delete it so just to show you I mean when we have uh okay I did something let me oh no what happened no problem because it's not save so no problem we'll add it I mean it's it's a okay so okay uh let me just add it not a big deal so we'll do it live okay learning in public we live on the edge all the time runs on the Edge by the way as well there you go so so anyway so what what did what did we lose that you now have to add uh I want to write a logic for my create operation I have update and delete so I deleted the create operation we'll do that SL well okay we have 27 minutes let's do this ah I think I'll not take more than five minutes oh here we go so people this is this is actually programming in automate live in action yes yes so you have a next step when you choose a Next Step there are three things either you can have a conditional path where you can write a condition action strip where we have a set of different connection here like in integration and all uh if you want to integrate with slack with other things Z we do have the AI stuff also like a Gemini I'll not go in into that let's because I have the time here so I'm just adding a repeat Loop and I want to have a repeat loop on a data source the data source which I received from previous step even that is something is some I have it available here so this is my response I want to so this is a response from the previous step that you can get as input for the next step yep which is so cool that alone me makes me so happy like Lo and I is such nerds right now yeah like oh my gosh isn't that easy yeah so you can see here I mean the current items is the first item over here and all of these items so my Loop is uh going on across each of these track API Keys now on this repeat I want to do one thing now the repeat is happening uh what I need to make sure like which particular action I need to perform so for that I can just simply use our utility okay this is like it's more of a do while do and then check while this condition something like that so you're kind of it's so it's not like a for each or like what is the it's like a do while okay yeah that's what it's yeah first do and then check I mean while the condition and all while something is still true do a thing essentially yeah yeah so what I want to do is this repeat path continue repeat path if condition so I want to have if condition here so I can say the conditions here again the same thing with we have seen earlier there is a option here to add condition I say from the content type trigger there is a event fi right so I can just simp there is a search also there so in case you have oh yeah this is that create thing we saw before yeah so I have a body. event is create and then you can have a different conditions saying okay equals to so I say matches Loosely I mean there are a lot of things I mean less than even if you are working with arrays or numbers and all you can do that I say match text equ ALS to create then and then only this continue repeat should work otherwise it should totally get out of this repeat and move to the next step and check right so there is a condition here uh exit the repeat part completely if it is not the creative right okay so then it just goes to the next one in the in the loop essentially so because it was a create event you can see the continue is true that means this repeat will work and exit repeat is uh true in other scenarios so save exit now I want to add my the next thing is the create part right so the to create it I just simply go to my content stack management apis for that quickly documentation I love all the built-in testing like at every step you can test to make sure yeah really going well exactly yeah and here we're now going to test the the the documentation search capabilities she's yeah we can do that I mean our search is very good that's that's but yeah I'll just simply go here I want to get the apis I can just simply say okay uh in my stack this is branches the content tabs create content tabs and what is the payload for it so you can have a this thing over here I want this URL and it's a post method it's a create event I'm just going here in my automate uh there is a cool things I mean there are uh HTTP so in this is something very powerful thing in case of you need to make an API call uh if we don't have an integration most of the time most of the integration are there but in case if we don't have integration you can always use request I select authorization so I select whatever the we have set up that authorization is here and I put the URL and the developer knows about it the post method it's a creat right and I want to of it so I just simply go here and just copy this part and let's do here on automate this I want so in this content type whatever is the trigger happened whatever the payload was there whatever the schema was there that schema I want to update uh in The Next Step okay even I can just simply get it from the content trigger here this is the uh the body uh one do body this is containing the whole schema that and now one thing is missing here if I try to publish it it's not because I I have chose the authorization but also there are Hider soer knows you need to have hiter right so keeping that in mind I just simply have a uh let's look at the hiter what are hiter I need I need the API key okay the API key so I go here AP key and the value so I want the value to be dynamic because this is a loop right you have to loop from the iterator nice so I just use uh the repeat path here and it gives okay I need uh one thing here quickly I just run that repeat again save for now go here and so you're doing is now on purpose so it it re-triggers your test right yes so I I I I just want to uh make sure that trigger uh the repeat path has values of it so whatever is generated here I want that object now I have that object the configuration saved now I'm going to use that in the here so I just simply go here on the repeat path I want the current it here we go I just adding that add header there are a few more things to add I go to the content types this is uh because it's a post method so you need to define the content type it is a Jon or or something else it is blob then you need to Define different so keeping that in mind I just simply go here and add content type oh yeah this application Json I think yeah yeah okay that didn't go I don't want to type I'm relax mode because I'm working with automate right I don't want to do a manual stuff stuff yeah and the next thing is this is a very powerful thing so if you look at the authorization it's a barrier and or token so I need to make sure it's barrier space or for that I just simp use this and go here add H and this data is again dynamic because I have authorization so you'll be able to find the account data inside the account data there is the access type uh which is token type token type is it not access token maybe uh yeah it's a token type and then I need access token so it's token type oh this is Bearer yeah exactly that's you're literally concatenate I think that string now yeah okay because that's what is needed now I hope it should work fine let's click onction cont okay why this is working fine so why it's not working here is the title is unique because I already have that particular uh whatever the page content type so it's not allowing me but it's working so if I delet oh yeah because it already exists because we're rebuilding it now our AP is fine uh you just need the conditional to see if you need to do create at all yeah yeah that's what I mean so um in that if I delete it uh in my child stag it will allow me to success but you know this works because it gives this error essentially because it wouldn't give that error otherwise exactly yeah it will give you a successful dude this is going pretty deep already I kind of like that you can do this much in it without actually writing a line of code yet yeah it's F I mean my create thing is that uh just for my uh readability I just make sure like the repeat path is for create repeat path this is again just to make sure not going deep into unchecking which API key so create repeat PA create operation I can say create content type so you can give a name to your steps so it's easy for you to understand okay which particular Loop is one now we have done with the create thing my create is back okay going back here again the same logic nothing the rocket science uh again the same uh repeat path on the response uh I'm checking a condition saying okay if it is a update if the uh value equals to update then perform the operation and here again I'm using a put method so you know I mean it's update and same thing so this one has a sub automation below it what does that mean ah okay so this is something you are ask me in the past okay oh I know okay so we have like 15 minutes we can we can talk about this talk about it yeah okay so let's talk about it so when you are deleting let's say you are deleting a uh take an example of the page so if you have a page content type and you are making a change let's go back here on my uh Master stack and content models page here so if I have a content fill okay uh which I can simply add it here just to synchronize I'll make sure my automate is running so let's keep this enabled oh you have to enable it though yeah yes don't forget to activate one thing is you are not allowed to make the changes if it is activated that is something again a good thing because if the automation is running and you're making a change it will break that's complicated yeah yeah again it's live now like we are live s so uh I click on the save here and I'm updating it I hope uh it should propag we can we can have a look here if this is happening oh it's running right now awesome success over here success I'm making this life successful so okay this content the spelling is wrong but it's fine so I'm going to a brand stack one uh going to that P content type I have there it is and if I create entries in that okay let's go and check the entries okay I have this test entry if I have some content here okay saying uh this is the content content save okay now let's go the use case so what will happen if I delete the uh and if I publish it let me just publish it also so when you publish it that content is something which will be available on your API keys and all right so now we use this basically live on our website yeah y yeah so you can see if I just close it uh we have a cool developer tools where you can just see the payload very instantly uh there it is content this is a Content uh this data is there and it's published it's AV label but let's think about if you're making a change in the content model the content model is updated what about your 200 and 300 entries you want to make sure like after you make the change that particular field data should also get removed right for that particular use case what because when you change one field like when you fix that spelling mistake let's say my field that says this is content is a different field so my data is gone so potentially for a thousand blog post you you kill the content yeah but again I mean still I don't publish because the version histories are there so if you look at uh uh these entries you have a version history right latest yes you can always go back that's nice yeah so always can you can go back to different versions but what will happen if I delete this content fi my version history which is like 15 version is published in the production so nothing is going to change on my API side okay because you just hit you do basically just do a save action not a publish yeah it's just a save I mean uh so you have a 15 version so what I want whenever I'm deleting a fill I want to make sure that fi data the key value data is also removed from my API gway I mean scdn site also so keeping that in mind I want this data to be deleted so for that particular use case it's specifically for update only because in create nothing is happening I mean it's you're creating a new content app so there is no entries but a delete if you're deleting a content type by default all your entries are deleted you have 200 entries and you're deleting a content type your 200 entries are deleting so this is a special case for update updating a Content Ty and updating and deleting a particular field which already have a lot of data and you have a published data so for that particular use case what we can do is you can h a sub automation so the Automation and the sub automation so I don't want to make this complex I want to make sure this automation is only for Content types but in certain scenario if there is an entry operation I need to do I can do the same logic here also but I don't want I thought of like keep the entries uh operation stuff as a separate Automation and this is my parent Automation and so from here I can just set up a sub automation where I need to pass a uid and stack API key this is the uid of that particular content which is updated and the St API key is because it's going in Loop so every time this sub automation is running it's running across different content yeah for all the stacks basically yep and for the loop yeah exactly yeah and what I'm doing simply in that particular uh sub automation is I'm just it's just simple thing I'm in sub automation this is that sub automation with its own tree essentially yeah this is only running for ENT and it's this automation will run only and only when there is a update opportunties happen Okay so so you can have these kind of like sub automations happening behind the scene for different different operations and all and what I want is when there is a sub automation on update I want to get all entries so again this is available in our contest te management get all entries I get a list of entries of that particular content I and if I have 200 entries I just use again the repeat path on that entry so you can see these are the entries right now I have just one entry because I created this entry you have 2 200 oh yeah we just have one for now yeah sure sure yeah and what I'm doing is I'm doing a force update here so so whatever the data is there uh it was like 15 and then uh the next version is 16 I'm making a next 16 whenever I'm updating it because I don't have that content type fi data in that schema so it will remove that particular content field which is uh the content i f itself yeah I so the update is done and now I want to publish it so the update will happen on let's say entry one and that will be published two and you have a th entries even that can be handle l so can you click edit for this one because I'm not sure I fully follow out this one oh okay yeah sure so if I go it's activated now of course it I can simply it here so this is just update like you had before yeah yeah I can just simply say update this is update on the entri so yeah this is an entry that's different you're right so I'm updating the entry whatever the entries I received of that particular content yeah so that these parts I get but then the you're actually doing like what are you specifically updating in that entry that's what I want to say so I'm updating uh the data I mean just updating I just simply say uh let me just keep uh here we will have the stacks and all whatever we are there so if I just this let me just refresh it so I get that yeah because you open it and suddenly all your stuff was gone yeah yeah so yeah it's always good time in uh make a clone again I are talking about a new thing if you're making a good big changes and you don't want to hit it there is a feature we call it as a Clon automate so you can clone automate and then make a change so that you're not losing it so again I'm not doing the cloning part here so that's my mistake but overall I think exactly all right coming in with the best practices oh yeah we need that stuff man because this is so powerful we need some best practices so what is this actually doing so you're finding the current entry ID because you get that from your Loop so you're setting data to current item that's all you do yes and whatever the data I have in that current entry same data I'm applying and then it's updating a version and while updating the version because I don't have a schema field to hold that data it just by default deleted and then and then I don't have the content which the content field is deleted uh on that particular entry also that content key value data is deleted and then I'm publishing Al yeah so you can now do an update to an entry or to a Content model and then that gets now then this runs and it basically just sets the data again and publishes it to all of them so you get a new version y this is after this step you will not see that content or let's say if you remove an author the author will not be visible on your website right because earlier when we were making a change in content types okay that that time we were not working with the entry so entry whatever the entri you have published uh that data is just sitting in the the fastly and caching and everything right yeah so I want to force update so make sure like whenever the content field is deleted that particular field is deleted the data should be removed from that CDN itself that is the task I'm doing yeah so you're literally this is almost like a cash Purge and re re this is it's a little brute forcey to me but I kind of like it yeah like the thing is it just shows what this thing can do and so we have like a few minutes left so if anybody in the audience has questions feel free to ask them by the way you can always ask them um so as she maybe oh we're we're going full force Inception now um is there something in automate you you might still want to show like is there something that you think that could help folks understand it a bit more or is there something we can do still in a few minutes to just show some extra Auto Magic okay okay let me just do one thing here uh let me just show you a few options I'm inan so what I can do is whenever there is a uh this event is happening this content type is triggered is happening I want to get notified via email so that okay yeah exactly it's a big change right you you want to know the five people yeah so for that it's very simple what I can do is I go to add new steps again in action step this is like a whole marketplace where I can simply we have our own email see email by automate so I just simply use that oh that's cool so the the email server is content stack Yep this managed by the content stack I just say Okay type the content stack this is my email ID you want to reach out afterward yeah was going to say you just now gave the internet your email but in your case that makes sense because you want to talk to people you're good yeah cool okay so the subject is content type so even I can make the subject line Dynamic okay so yeah you can just grab it from another step right content yeah I can say which content app right so I can just say uid I search for uid uh and this is a page uid so I can say page uid content typ got and now I want to work with event right yeah is it an update or is it like this oh this is so cool dude so the subject line is totally Dynamic so now I can say pH content type got updated and it's finally Dynamic and the same thing I can I can have there's a different body Ty type if you want to have a newsletter something like that you can create HTML I'm just using a text here uh content type and also I can uh do uh I need to specify a cc or I need to add add additional stuff oh dude this is so this is so cool yeah I can can you spell your B yeah double n i KS and now you give my email as well also for me it's fine no worries people can have this one just not my phone we want to help people I mean so yeah yeah we're good so now if I hit the test action you should have received an email so that you can just simply I I just got it already holy moly I won't share my screen but I can trust trust me I just got it that's awesome and so you could do the same with Slack you could do whatever you want basically here right yeah there's a slack any I mean even if you want to let's say there is a good use case I can say this is a big operation a lot of our customer use J board so we have so if you want to update a jir so you can just search for G here and there you go I mean which if you want to create a task for other folks you want to create an issue an update an issue you can do that integation so you also make a trigger from a jira ticket to start yeah you can do that so do a whole J workflow essentially basically building your whole process yeah even even I can talk about more things like uh when you're updating the content Tab and you're updating let's say in sub automation the entries are updating if a customer using algolia or elastic search where they want to have Advance they want indexing right so even that is something we already have it here you just simply need to configure your algolia Integrations after the update is happening on entries your alol data base is getting Pur I mean it's indexing is happening elastic search is there even if in case of like the chat GPT uh you can easily I mean write something about what exactly happened with this thing and create a summary of it and send it to anybody and or you want to review something like that you can do it a lot of things I mean we keep on adding here even one more thing launch so launch is a content strip feature a product itself where you can host your website so after my content type got updated my entries are updated I want to trigger a build because if it is a static side generator like next next so catsby uh you need to trigger a build so that operation I can do it so after an update happening in the sub automation I can just see okay in the launch just deploy a build or revalidate the redeploy so lot of things I mean you can do I can spend another two three hours dude we'll have you back on I'm sure we still need to talk about all the stuff AI can do in here like there's so much like I've had a bunch of different meetings with folks working on this product and every time they show something my mind is blown every time and because I'm an old school developer doing all this myself in no GS scripts and yeah we don't have to do that anymore I I think we have done a lot of use cases with AI the mongodb webinar was something like I work with the Mong be on that like we have a lot of things at the time which used to take around like 10 days now they can do within a minute or something and I just like how like from an organizational like it management perspective right in automate you can see all the flows and tell exactly what the steps are and a lot of times when you do this sort of thing manually the code may not be annotated it may not be very clear what's happening and if the person who made it leaves the organization right other people are left with this code not really understanding the purpose or why it happened but when you have it all together and you can actually annotate it and you can send messages about it it makes the whole process move much faster between the team right yeah governance is a thing man it's so important and even even sometime the things goes wrong sometime the execution is failed so we have the execution log oh yeah I can show that here on the screen it's not always a success if you go down here if I go to Pages there has been some fail scenarios I can just simply go here white C fail you can see each and every step and which particular step the fail was there and I canly go this is just awesome unbelievable R Li so because it was a big operation so there is a content type rate limit and all so I just fix it and my things are working so anything goes wrong there's a thing to uh I mean do a consult logging and everything that so this is again a very powerful thing yeah it's it's kind of fun that we keep being surprised but we're just showing our age because Back in the Day none of this existed or worked and so for I guess for you she is pretty normal and I'm like holy moly this is all just yeah how is this definitely push and prey is what I used to call it my with yolo in them you know what I mean anyways we are on time we are exactly one hour and one minute so thank you so much ases I think it's time for us to do the following join our Discord so we I just put in like a little Banner here below because if you join our Discord you can talk to folks like AIS or me or Lo to about what you've built you can show what you've done and I think we just put a like a little comment with the actual link so if you're watching just go in um I think that is only for YouTube and not LinkedIn by the way but we we'll figure that out for next time I think anyways thank you everybody so much asish especially I know you worked hard on this and it's just it works super well it's fantastic exactly so L did we have a planning for the next stream yet do we have a date or do we update folks a bit later we'll update folks a bit later because I think we will take some time for holidays and then we'll be back in January all right um thank you so much and as this is the first stream and our marketing team is awesome let me show you what they made for us I'm going to just put this and then we end the stream watch this amazing yes shout out to the digital team at content St it's just y'all did an amazing job all right dxp BS all the things all right cheers everyone have a good one bye everyone and I just clicked end and now
