Python-powered chat apps with Twilio and SendGrid Transcripts
Chapter: Messaging and workflows with Twilio Studio
Lecture: Restarting running workflows

Login or purchase this course to watch this video and the rest of the course contents.
0:00 One thing you can run into that's a little not obvious.
0:03 Once you see it is completely easy to fix.
0:05 But knowing what to do here,
0:07 it's not entirely obvious. So let's suppose we've started our conversation with Cloud City Cake company.
0:13 We're gonna love a small cake with some vanilla flavor.
0:18 But for our frosting, we want Mapel,
0:21 I notice here there's a little problem.
0:23 Vanilla cake Sounds delicious. Oh,
0:26 well, that's no problem. We can go fix that.
0:28 Let's just go back to the studio and I'll make a change here.
0:32 So we're asking for the frosting.
0:33 We want that little space, right?
0:36 Like so, we hit save, Perfect.
0:41 We're ready to fix our problem.
0:42 We can publish it. Let's go back over to WhatsApp and see if I fixed
0:46 it. maplee. We're not maplee Wait a minute.
0:52 What's going on here? Why am I still seeing this old one?
0:58 What happens is, once you start one of these workflows,
1:01 you're tied into that version of the workflow.
1:04 And if it's in flight after changes are made, well,
1:07 too bad you won't see those.
1:09 That's totally good. It means it's consistent.
1:12 And, you know, maybe there were questions that were needed later that would not
1:14 have been asked because you're already halfway through it.
1:16 You don't want it to restart.
1:19 You want to just carry on.
1:20 And yet, as a developer,
1:23 you probably wanted to restart. You're like,
1:25 Okay, great. We'll just start over.
1:28 Hi. Let's just start this conversation over, so I can fix.
1:31 I can verify my fix for my changes.
1:34 Wait a minute. No matter what I type here, I am stuck halfway through this
1:38 workflow. So one thing you could do that's painful is to make your way all
1:42 the way through it. Another thing you can do is click a button over in
1:46 studio and say, Cancel this and the next time you talk to it will start
1:50 over. Over here remember, we've already made our fix,
1:54 but we have these running workflows.
1:55 If we come out of full screen mode and go to logs over here,
1:59 notice there's this one that's running right now.
2:03 This is the one that I was trying to get out of,
2:05 the one we just saw. So let's stop the execution.
2:08 We'll just go back to the editor.
2:10 Doesn't matter. But that's where we want to be.
2:12 And back to WhatsApp. Now,
2:14 if I type hi. Greetings from Cloud City.
2:18 What size of cake would you like?
2:20 Well, I would like, uh,
2:22 large. That made me hungry.
2:23 That bug hunting. So here we have our rainbow and look at that fixed rainbow
2:29 cake, Sounds delicious. What kind of frosting would you like with it?
2:33 So that's how you can exit out of or stop these running instances of these workflows
2:38 with your WhatsApp instance to say,
2:40 No, no, no. I want to start over.
2:42 Let's try again. I've made some changes.
2:44 Just drop what you're doing and start over.
2:45 So this is really important as a developer to make it really easy to jump back
2:50 and check out your changes and so on.
2:52 It doesn't really much matter in production.
2:54 Most of the time, people won't be in those problems. It maybe but is really something you are going to do frequently as a developer.