# Use Case: Translation with ChatGPT

### About this export

| Field | Value |
| --- | --- |
| **content_type** | lesson |
| **platform** | contentstack-academy |
| **source_url** | https://www.contentstack.com/academy/courses/automate-foundations/use-case-translation-with-chatgpt |
| **course_slug** | automate-foundations |
| **lesson_slug** | use-case-translation-with-chatgpt |
| **markdown_file_url** | /academy/md/courses/automate-foundations/use-case-translation-with-chatgpt.md |
| **generated_at** | 2026-05-11T07:02:18.643Z |

> Part of **[Automate Foundations](https://www.contentstack.com/academy/courses/automate-foundations)** on Contentstack Academy. **Academy MD v3** — structured for retrieval; no quiz or assessment keys.

<!-- ai_metadata: {"lesson_id":"22","type":"video","duration_seconds":834,"video_url":"https://cdn.jwplayer.com/previews/T1PfSEIE","thumbnail_url":"https://cdn.jwplayer.com/v2/media/T1PfSEIE/poster.jpg?width=720","topics":["Use","Case","Translation","with","ChatGPT"]} -->

#### Video details

#### At a glance

- **Title:** Ah-chatgpt Translations Example
- **Duration:** 13m 54s
- **Media link:** https://cdn.jwplayer.com/previews/T1PfSEIE
- **Publish date (unix):** 1713750111

#### Streaming renditions

- application/vnd.apple.mpegurl
- audio/mp4 · AAC Audio · 113508 kbps
- video/mp4 · 180p · 180p · 143948 kbps
- video/mp4 · 270p · 270p · 161578 kbps
- video/mp4 · 360p · 360p · 182141 kbps
- video/mp4 · 406p · 406p · 193844 kbps
- video/mp4 · 540p · 540p · 232421 kbps
- video/mp4 · 720p · 720p · 294709 kbps
- video/mp4 · 1080p · 1080p · 426845 kbps

#### Timed text tracks (delivery)

- **thumbnails:** `https://cdn.jwplayer.com/strips/T1PfSEIE-120.vtt`

#### Video transcript

In this video, we'll take a look at using ChatGPT to create a translation workflow with ContentStack. Here I have the ChatGPT automation open. You can see that I begin with a workflow trigger. We then get the entry from workflow. Next we could use an API call to get the languages list from ContentStack and finally repeat over those locales located in our stack and with each locale, we translate the title, we then log it, and finally we update the entry. Let's go ahead and get started. Okay, the first step is going to be for us to create the workflow trigger. So navigate back into ContentStack, go to settings, and inside settings, choose workflows. If you don't already have a blog workflow set up, then come over here and create a new blog workflow. We're going to specify that this is used on the blog entry content type that's in my starter app with Next.js. And then finally down here, you can see the different stages I have. What we want to do is have a send to translation stage, and that's going to be the trigger to send this translation to ChatGPT. After that, we have a review translation stage, which is usually recommended so we can review what comes back. And finally, it's going to be approved for publishing. If you don't already have this set up, go ahead and set that up right now. After that, make sure you check enable workflow and then click the save button. Now that we have our workflow in place, let's go back into Automation Hub and take a look at our automation. So we're going to start with that workflow trigger, and then we're going to get the entry from workflow. So I'm going to go ahead and go to my automation dashboard and create a new automation. In this automation, I'm going to choose ContentStack and then a workflow trigger. Make sure you're logged into ContentStack with your account and then choose workflow state changed. Here I'm using the Next.js starter, and then finally the content type, which is going to be the blog entry. Over here under workflow, that's going to be the blog workflow we just created, and then under optional steps, go ahead and choose that step, send to translation, and go ahead and click proceed. Great. Let's go ahead and test the trigger now. So click test trigger, go back into ContentStack, and let's just open any of the blog entries and update the workflow settings. So here in my blog entry, I'm going to go ahead and open the workflow details, set stage, and then I'm going to set the stage to send to translation, click save. Going back in the automation hub, go ahead and click retest, and you should see the JSON of the entry appear here. As a final step in our workflow trigger, we want to make sure that we have tested it. So let's go over here to step four on the action one, click on edit, and then if it says that was skipped, go ahead and click test trigger here, and then if you haven't done that yet, then you need to come into ContentStack, do workflow details, change, and send to translation, finally clicking update. So that will test the trigger, and that's super, super important. Okay, let's go ahead and click save and exit. Now in the next step, we configure action step. We want to go ahead and get the entry that's in the workflow. So to do that, let's click action step, choose a ContentStack connector, and then down here under entry, choose get single entry. The reason we need to do this is because we're going to translate the content in this entry, and we're going to need all the JSON fields that it contains. Our initial workflow trigger only contains the workflow information, and we don't get all the content of the entry that's inside the workflow. So this is going to give us the content of the item inside the workflow. Let's go ahead and select our stack. That's going to be our starter app. Down here under content type, let's go ahead and choose a suggested data element. So this is the content type from within the workflow. So that's a blog post. Under entry, let's also go with our suggested entry UID, and again, that's coming from the workflow. So this looks great. Let's go ahead and take a look at the selected fields here. We see we could add in a version, a locale, or other information. We don't need those for now, so we're going to leave those empty. Go ahead and click proceed. Go ahead and test the action here, and we can see we've got the JSON coming back of our entry with all the fields. That's it for the first part of this example. The next step, we're going to take a look at using the repeat action. The next step of our automation, you want to get a list of the locales available in the stack. To do that, we're going to use an API call. Going over to our documentation, this is the content management documentation for the content management API. You can see that we have a get all languages option, and that API call allows us to get the locales in the stack. The requirements that we have in the headers are either an auth token or an authorization, which is a management token. That's the option we'll use, and then finally, an API key. So let's go ahead and get started. Let's first go ahead and copy this command here, locales, and add it into a new connector here. We're going to choose action step, and then over here under the connectors, we're going to use the HTTP connector. We're going to send an HTTP request, and we're going to paste in that URL for the content stack API. That's a get request. We are going to need those optional header fields, so click on the optional fields and choose add headers. Okay, what does it require? It requires an auth token or authorization token. So let's go ahead and choose authorization, and we'll create a management token in just a moment. So here's my authorization, and then the value, I'm going to go back in the content stack, click on settings, and then click on tokens. We're going to create a management token for this step. You do need to be a developer or an admin to access this functionality. So click on management tokens, and then click on plus for management token, and here I'll just say this is my automation hub token. Read and write, and go ahead and click generate token. Copy this token here, and once we click done, we cannot access this token anymore. So make sure you paste it in your password manager or someplace that you can bring it back later, because otherwise you'll have to make another management token if you don't have access to this in a text file or a password file. Okay, click done, and so now we've got the management token. We want to go ahead and paste that over here. Now the next thing is an API key. Let's see the format that it needs it in, so just like that, and the value you can find in content stack after the word stack. That's your API key. So that's one way to get it. The other way to get it is to open up your token. You can also read it right here, okay, and that's all we need to do for our request. Let's go ahead and hit proceed and test it out, and here you can see a list of the locales I have available in my starter app. That should match my settings and my languages list over here, and it does. So that's it for this step. Let's go back to our automation, and in the next step, we're going to use a repeater to repeat through this list of locales. In the next step, we're going to use a repeater and repeat through our list of locales. Let's get started. Click add new step, and over here, choose a repeat path. Let's choose a data source, and now we want to select the HTTP request result that has a list of our locales. Opening that, we can see we've got body.locales, which is an array of all the locales available or languages in our stack. So click on that, and then go ahead and click save configuration, and you should see something like this. Great. So now we've got a list of each of our locales, and each current item is going to point to the item inside the loop. So let's first go ahead and access the ... see what we do here, translate the title. So first we want to do the chat GPT connector, and I'm just cheating here, looking at my settings on the other side. I'm going to go ahead and copy this, just so I don't need to do that again, and come back over here. So in the action step, let's choose chat GPT, and then choose chat, and down here, we want to go ahead and log into our chat GPT account. I've already done that. Choose your model, and then select prompt text. You can update this prompt text with something that you find is more relevant, it might help the quality of the translation, but I've found this works fairly well for me. So what I'm doing is, as a translator, translate the text, entry.title, into the language with the language code, my current item.code. You can find those properties down here. For example, in the repeat path, you can see that I've got my current item code right there, and that is actually the language that's inside the repeat at the moment. The entry title is also very easy to access, and that's over here under the get single entry, and then you want to go ahead and you can search this if you want, search for title, and there it is right there. So there's how you access the two properties for that. The user role, I usually use system, and then hit proceed. Go ahead and test this action here, and you should receive back the translated content. That's looking great. Okay, let's save and exit. Now what I usually like to do here is log this somewhere to make sure it's actually working and test it. So one quick and easy way to log it is actually just with a HTTP call to a webhook.site. So I'm going to go ahead and do that, create a new HTTP request, come over here to webhook.site and create a new listener. Let's see here, let's copy that URL, and coming over here, let's paste that, and I'm going to post the body, and inside the body, I'm just going to paste in the result of chat GPT. So I'm going to paste in here, let's see here, the content. And I could also paste in something else from the repeat path, I could also say the name of the language. We can also, let's maybe I'll put this, I can't do that first. Yeah, okay, we can keep it like this, it's fine. All right, so that's about it. Let's go ahead and hit proceed and test action. And over here, we see that we've got our text coming, so that looks really great. Okay, so coming over here, save and exit. The last step we want to do is update our content stack entry and paste in this localized content. So click add step and configure action step, choose content stack, and then over here choose, let's see here, update entry. Select the stack, it's going to be our starter app again, select the content type, I'm going to use a content type from within the workflow. And also under entry, I'm going to use the entry ID that I got back, I can use either one, they're exactly the same, but I'll go ahead and use a workflow item as well. Under the entry data, I'm going to go click on the that arrow there, and it gives me a copy of the schema and all the fields. Now we only need the title, so I'm going to remove the other ones here. So I don't need, for example, I don't need a lot of this actually. So I have two open brackets at the top, and I only need two at the bottom. So we'll just make it look like that. There we go. And where the value of the title, I'm going to pull that back from the chat GPT answer. And that is right over here. So that's it for the content. I am going to need the optional fields because we want to use the locale. So here we can see that we've got data from a previous step. And what I really need to do here, though, is to access the output from previous step and come down here and inside my repeat path, I have that locale, right? So I want to go ahead and use this item code right there. Okay, and that should be it, hit proceed and go ahead and hit test action. It says it was localized successfully, and the title is this. Let's go ahead and look at that in content stack now. And let's take a look at what that unique ID is. There we go. And here you can see this is the localized article. You can also go to the English copy and again, back into the Italian. Great, so let's go ahead and actually do this for real, turn on the automation and run it for all the languages. Hit save, I'm going to turn this on right here, activate it and come back into my English copy. Go over here to workflow details, change, send to translation and click update. Now going back into automation hub, we can go look at the log and see if it's execution log and if it was executed, if it was successful or not. You can see I have some successes and failed ones before. Success, great. So I can go ahead and open that one up and actually tell me how long each of those requests took. The repeat path took eight seconds for the translations. You can see how many seconds each one took. Okay, so let's open that item in content stack again. Let's choose another language. So let's go into French. Here we can see our copy titles in French. Then we can also check it down here in Germany as well. All right, great. So if you followed along this far, congratulations. You've now successfully created an automation using ChatGPT and updating the title of an entry. Thank you very much.

#### Key takeaways

- Connect **Use Case: Translation with ChatGPT** back to your stack configuration before moving to the next module.
- Capture one concrete artifact (screenshot, Postman call, or code snippet) that proves the step works in your environment.
- Re-read the delivery versus management boundary for anything you changed in the entry model.

## Supplement for indexing

### Content summary

Use Case: Translation with ChatGPT. Use Case: Translation with ChatGPT in Automate Foundations (automate-foundations).

### Retrieval tags

- Use
- Case
- Translation
- with
- ChatGPT
- automate-foundations
- lesson 22
- Use Case: Translation with ChatGPT
- automate-foundations lesson

### Indexing notes

Index this lesson as a primary chunk tagged with lesson_id "22" and topics: [Use, Case, Translation, with, ChatGPT].
Parent course slug: automate-foundations. Use asset_references URLs as thumbnail hints in search results when present.
Never surface LMS quiz content or assessment answers from this file.

### Asset references

| Label | URL |
| --- | --- |
| Video thumbnail: Use Case: Translation with ChatGPT | `https://cdn.jwplayer.com/v2/media/T1PfSEIE/poster.jpg?width=720` |

### External links

| Label | URL |
| --- | --- |
| Contentstack Academy home | `https://www.contentstack.com/academy/` |
| Training instance setup | `https://www.contentstack.com/academy/training-instance` |
| Academy playground (GitHub) | `https://github.com/contentstack/contentstack-academy-playground` |
| Contentstack documentation | `https://www.contentstack.com/docs/` |
