# Building a flow: a virtual AI editorial office

Nowadays it is possible to employ AI for writing blog posts, email letters and what not. But straightforward approach may give the result that is far from ideal. To fix this and boost the quality we're going to gather an AI team that will help us write captivating texts. The team will consist of two authors, a proofreader, and a leader, who will choose the final result.\
\
As an example, we'll take the case of writing a text about a consumer product. The text should be fit for the product website, marketing materials, and so on and so forth.

{% hint style="info" %}
[Video version](https://www.youtube.com/watch?v=01rg9fbKNKQ?utm_source=scade_gitbook\&amp;utm_medium=organic\&amp;utm_campaign=default) of this tutorial is available as well
{% endhint %}

1.  Go to the [Flow](https://app.scade.pro/flow) and click the "Create" button. \


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FS0ShVywntOj7kGfOpLwY%2FScreenshot%202024-01-26%20at%2015.35.13.png?alt=media&#x26;token=f9e970f4-2c6e-4ca9-bef0-830509d9b35d" alt=""><figcaption></figcaption></figure>

    \

2.  It's a good practice to store all your input data in a single node. Start by typing `user input` in the search bar of the left panel. Locate **User-Defined Input Form** and drag it to the workspace.\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FcKrybPwo5XntwrOAlTD3%2FScreenshot%202024-01-24%20at%2022.27.35.png?alt=media&#x26;token=aeda2148-88f6-4ee6-9acc-bd8be0410e8f" alt=""><figcaption></figcaption></figure>

    \

3.  This node has no pre-configured fields, so we should set them ourselves. Dive into the node’s settings and select **Configure Fields**. \


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FqnzeHyqOQV67Gl48ydws%2FScreenshot%202024-02-08%20at%2021.45.19.png?alt=media&#x26;token=cebaad64-e7d7-4a65-8448-5fd220048bdf" alt=""><figcaption></figcaption></figure>

    \

4.  Add a field and name it `product`. We will put basic info about our product here. Don't forget to click the **Save** button\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FEgy3iUTV7LAutbRbXrRN%2FScreenshot%202024-02-08%20at%2021.49.14.png?alt=media&#x26;token=cb5b2096-7a37-41d4-921c-2e984d457614" alt=""><figcaption></figcaption></figure>

    \

5.  Return to the **User-Defined Input Form** node. Let's say, our product is a makeup kit for teenagers. Type the text "makeup kit for teens" into the **Product** input of the node\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F6IY5OMuG2WYa3dcViui2%2FScreenshot%202024-02-08%20at%2022.00.16.png?alt=media&#x26;token=58da54f4-6088-499e-ae1f-0153ed78f4a2" alt=""><figcaption></figcaption></figure>

    \

6.  Hit the **Execute** button and then click **Save and execute** to run this node and generate the custom output.  We need it to move further.\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2Fe1nimSbIFfCTo54xT2aT%2FScreenshot%202024-02-08%20at%2022.00.51.png?alt=media&#x26;token=939a7203-c71c-4e4c-935e-ef3deb4498ff" alt=""><figcaption></figcaption></figure>



    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FmMha20v1arDz9yBN7gK6%2FScreenshot%202024-02-08%20at%2022.07.39.png?alt=media&#x26;token=f8e42706-3809-4e1c-8dc8-9bd9fea159f4" alt=""><figcaption></figcaption></figure>

    \

7.  Now let's start gathering our team. To hire the first author start typing `chatgpt processor` in the left panel and drag a **ChatGPT Processor** node to your workspace.\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FFzTaLvbyqWsCKz6GiirY%2FScreenshot%202024-02-08%20at%2022.16.13.png?alt=media&#x26;token=8692dac8-b87d-4c0d-8299-99af8a0b1aa4" alt=""><figcaption></figcaption></figure>

    \

8.  Go to settings of the **ChatGPT Processor** node. \
    \
    You can choose ChatGPT versions with the **Model** dropdown. Let's choose gpt-4 for its advanced writing capabilities.\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FLhXjJ1Ok0sNp4bPIBy8Z%2FScreenshot%202024-02-09%20at%2008.49.36.png?alt=media&#x26;token=06123f8a-3880-48e6-a43a-0944c1232fcf" alt=""><figcaption></figcaption></figure>

    \

9.  Now it's time to prepare ChatGPT for receiving instructions. In the settings, go to **Messages** section, click on a pencil and a new message\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FOrmd7zSR8DYge82LEcO6%2FScreenshot%202024-02-09%20at%2008.52.48.png?alt=media&#x26;token=1bb0c2cb-12ac-449f-9c49-9a4ad248bd87" alt=""><figcaption></figcaption></figure>



    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F8MWkCtcA8Y5ORAbVoW5W%2FScreenshot%202024-02-08%20at%2022.32.39.png?alt=media&#x26;token=06b2caad-2c3e-4281-aa4c-6764f5564ada" alt=""><figcaption></figcaption></figure>

    \
    \
    Change the type of the message to `System` as recommended by OpenAI to emphasize that it's a high-level instruction and to guide the model's behaviour\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FXUqf09LVL70gaxqUbRA5%2FScreenshot%202024-02-08%20at%2022.32.59.png?alt=media&#x26;token=b34e10c7-e38f-44eb-9a63-02115dd492ef" alt=""><figcaption></figcaption></figure>

    \

10. Paste the text of your instruction to the **Message** field. \
    \
    Here's mine, you can modify it freely or come up with your own:\
    \
    `You are an experienced author of marketing texts who likes the most specific and meaningful pieces. You have presented hundreds of successful products.`

    `A client comes to you with a request. He needs to create a description of their product for a marketplace. The description should be brief, but able to catch customer's attention. Focus on the advantages of the product and the advantages of its use.`

    `2 scenarios are possible:`

    1. `if the client sends only the name of their product, then the description must be written fully from the very beginning;`
    2. `if the client sends a ready-made description, then it is only needed to correct it if necessary; all specific factual data about the product must be left unchanged.`

    `You should give only a description of the product as a result, without any introductory words.`\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FydJu15Mr3bPPpq5oEGT6%2FScreenshot%202024-02-08%20at%2022.45.09.png?alt=media&#x26;token=9af6cc63-8eab-4198-b2b2-ca9ed9a1aa7d" alt=""><figcaption></figcaption></figure>

    \

11. We're not done here yet! We need to get data from the **User-Defined Input Form**. \
    \
    Add another message (there's no need to change the message type this time)\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FxfE2sNGdpgfMcK1Tw6c6%2FScreenshot%202024-02-08%20at%2022.49.36.png?alt=media&#x26;token=596c021b-1e54-44b1-8669-03e0dd8fd9da" alt=""><figcaption></figcaption></figure>

    \

12. Here things will become a little bit tricky. Due to the syntax of the **ChatGPT Processor** node we will need to use **Expression editor**. \
    \
    Click on the **#** symbol in the lower **Message** field\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FWpE416LDR4B3YszYW23n%2FScreenshot%202024-02-08%20at%2022.53.19.png?alt=media&#x26;token=f76bad08-3cfc-4f89-a471-317bc783033f" alt=""><figcaption></figcaption></figure>

    \
    \
    You'll get the **Expression editor**. There is a list of the nodes on the left. Click on the **User-Defined Input Form** to see its output\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FULVF4bHavjmernGebpaI%2FScreenshot%202024-02-08%20at%2022.54.15.png?alt=media&#x26;token=4d4d062c-3c47-4398-992f-ebf064b561f1" alt=""><figcaption></figcaption></figure>

    \
    \
    Drag the **product** output to the expression field\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FNggyzlYO9O9AGndHrQZ7%2FScreenshot%202024-02-08%20at%2022.54.29.png?alt=media&#x26;token=8bd6dea8-da84-4eca-812b-8611fe73ea15" alt=""><figcaption></figcaption></figure>

    \
    \
    The result should look like this\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F7YPLPsmJPZJP3znxxM0a%2FScreenshot%202024-02-08%20at%2023.00.01.png?alt=media&#x26;token=11867cc5-571c-4667-86e4-44fd6b13abd1" alt=""><figcaption></figcaption></figure>

    \
    \
    Click the **Save** button in the **Expression editor** and don't forget to click top-right **Save** as well before leaving the settings\

13. Connect the output of your **User-Defined Input Form** and the input of the **ChatGPT Processor**.\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FKs3jvQ429P5R4xBpZYGF%2FScreenshot%202024-02-08%20at%2022.24.02.png?alt=media&#x26;token=e524acd9-3901-4d43-87d9-76e83a2b8b6d" alt=""><figcaption></figcaption></figure>

    \
    \

14. We can add notes that help us to navigate through the flow and can store any additional info like comments. There will be two virtual writers, so in order to not mess things up let's add a note.\
    \
    Right-click on your workspace somewhere near to the **ChatGPT Processor** node and choose **Add note**\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FaQGzYFbz2M7FsZOoT0Td%2FScreenshot%202024-02-08%20at%2023.06.59.png?alt=media&#x26;token=b34a9182-3c61-453d-a5cf-077187dc0136" alt=""><figcaption></figcaption></figure>

    \
    \
    \
    As our instruction states, ChatGPT should assume a role of the author who values specific and meaningful texts the most. So let's write on the sticker something akin `Author #1: precise and specific` \


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FhFTczN9xrH5wdl7A3Agl%2FScreenshot%202024-02-08%20at%2023.07.35.png?alt=media&#x26;token=f332d373-6bff-4c48-ba88-3f2cb67fd18e" alt=""><figcaption></figcaption></figure>

    \

15. To add another author we should repeat basically the same actions:\
    \
    a. drag another **ChatGPT Processor** node to the workspace;\
    \
    b. connect the **product** output of the **User-Defined Input Form** with the input of this **ChatGPT Processor** node;\
    \
    c. go to the **Settings** of the node and change the model version (preferably);\
    \
    d. without leaving the **Settings**, add a message and change its type to `System`;\
    \
    e. paste the instruction for the second virtual author — obviously, it should be somehow different from the instruction given to the first author; for example, here's mine:\
    \
    `You are a brilliant marketing professional who makes short but vivid descriptions for any product. You have presented hundreds of successful products.`

    `A client comes to you with a request. He needs to create a description of their product for a marketplace. The description should be brief, but able to catch customer's attention. Focus on the advantages of the product and the advantages of its use.`

    `2 scenarios are possible:`

    1. `if the client sends only the name of their product, then the description must be written fully from the very beginning;`
    2. `if the client sends a ready-made description, then it is only needed to correct it if necessary; all specific factual data about the product must be left unchanged.`

    `You should give only a description of the product as a result, without any introductory words.`\
    \
    f. add another message and using the **Expression editor** refer to the data from the **User-Defined Input Form**;\
    \
    g. (optional) add a note about the second author.\
    \
    If you're a little lost, be sure to scroll this guide a little bit back. There are detailed instructions for all these actions starting from the guide item #7\
    \
    Your workspace should look like that at this point:\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FJD3YcgqEjvRib4LsUvoA%2FScreenshot%202024-02-08%20at%2023.36.28.png?alt=media&#x26;token=cb78790e-1bf8-4b49-b358-89f062343038" alt=""><figcaption></figcaption></figure>

    \
    \
    And the insides of the second **ChatGPT Processor** node — like that:\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FoCMlUKoFzMc0rMZZwwS5%2FScreenshot%202024-02-08%20at%2023.31.07.png?alt=media&#x26;token=e989f2fc-165e-418f-be67-71b6433be6d9" alt=""><figcaption></figcaption></figure>

    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F7NWoXjQAL8NKffEn7cPR%2FScreenshot%202024-02-08%20at%2023.30.55.png?alt=media&#x26;token=db96fe55-c0bb-4d4d-8807-1dfc6ffd4046" alt=""><figcaption></figcaption></figure>

    \

16. We need to run our workflow before moving any further. Hit the **Start** button on the top panel and choose **Save and execute** when prompted\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FRuPP2adYafjDDAqfy2rb%2FScreenshot%202024-02-08%20at%2023.41.46.png?alt=media&#x26;token=530e1f77-64b3-4424-9cc2-5d0d8e744b70" alt=""><figcaption></figcaption></figure>

    \

17. Let's add a proofreader to check the generated texts and correct them if necessary. \
    \
    Yet again, it's more or less the same routine — refer to items 7-10 of this guide for the detailed description of the actions:\
    \
    a. add the third **ChatGPT Processor** to your workspace;\
    \
    b. connect the **Success** outputs of both "authors" to the input of this node;\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FhGggyXiVNyxWq1Sx9xIw%2FScreenshot%202024-02-08%20at%2023.49.01.png?alt=media&#x26;token=913fe9c2-8cd6-4210-8b1c-6bd7ab551472" alt=""><figcaption></figcaption></figure>

    \
    \
    c. change the model version in the settings to gpt-4;\
    \
    d. add a `System` message like that:\


    `You are a highly skilled proofreader. Your tasks are:`

    * `carefully read 2 product descriptions;`
    * `remove all spelling, punctuation or stylistic errors or inaccuracies from the text;`
    * `remove all dubious or incomprehensible comparisons;`
    * `remove excessive marketing cliches, make the text easy, understandable and pleasant;`
    * `be very strict in the selection of material, it is better to remove more than to leave bad material.`&#x20;

    \
    e. add another message and open the **Expression editor**; \
    \
    f. drag **success** outputs of both "author's" nodes to the expression field \


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FarXA9HOeFe0KuYRDWB9P%2FScreenshot%202024-02-08%20at%2023.54.08.png?alt=media&#x26;token=490307ae-1e22-4365-ae8f-fb3399db876f" alt=""><figcaption></figcaption></figure>

    \
    \
    g. place the expressions that you get on different lines and enumerate them\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FeXhqStmYoMYllLFw0qEr%2FScreenshot%202024-02-08%20at%2023.58.12.png?alt=media&#x26;token=90f2689a-083e-47c7-924d-98fdc784ff93" alt=""><figcaption></figcaption></figure>

    \
    Don't forget to save everything!\

18. Run the "proofreader" node by clicking the **Execute** button on it\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2Fgi50n8CK9U0Ff68qb1Vu%2FScreenshot%202024-02-09%20at%2000.00.18.png?alt=media&#x26;token=63089caf-8762-4dbd-910c-7307a38b71f1" alt=""><figcaption></figcaption></figure>

    \

19. And finally, let's bring in the product owner. It's their responsibility to choose the best text.\
    \
    It's **ChatGPT Processor** again, so please refer the guide starting from item #7 if needed\
    \
    a. add the fourth **ChatGPT Processor** to your workspace;\
    \
    b. connect the **Success** output of the "proofreader" node with the input of this node;\
    \
    c. change the model version in the settings to gpt-4;\
    \
    d. add a `System` message like that:\
    \
    `You are a successful seller of goods on the marketplace, the editor will now send you a description of the audience and 2 text options.`

    `Your task is to choose the best text that will increase your sales. The text should catch the audience as much as possible. Write out only the text itself. If suddenly there are errors or strange words in the final text, correct them.`\
    \
    e. add another message and using the **Expression editor** drag the **success** output of the third **ChatGPT Processor** to the expression field;\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F2FN2w6qFTi46DBVE7P95%2FScreenshot%202024-02-09%20at%2000.08.09.png?alt=media&#x26;token=7f781961-1e03-46f1-8b82-a61ecdf18fe6" alt=""><figcaption></figcaption></figure>

    \
    \
    Make sure you've clicked the **Save** buttons!\

20. Hooray, let's see the choice. Hit the **Execute** button on the "product owner" node\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2Fo1byJpRWBnIkS6ZWQ35k%2FScreenshot%202024-02-09%20at%2000.14.48.png?alt=media&#x26;token=0f7138c1-cf7a-49c1-bbfa-6e65b87032ce" alt=""><figcaption></figcaption></figure>

    \

21. Nice! Now we can copy this final text and use it on our website, or as a product description on a marketplace\


    <figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2F2vS94rfS119Yh6nrRaS1%2FScreenshot%202024-02-09%20at%2000.17.51.png?alt=media&#x26;token=da833025-b6b4-4dfd-960d-77053d51776f" alt=""><figcaption></figcaption></figure>

    \


Once you have the workflow built, there's no need to run nodes one by one anymore. Simply change the **product** text in the **User-Defined Input Form** and use the **Start** button on the top bar

<figure><img src="https://2793209830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNCrOWKpBlXYnNB9SFIzb%2Fuploads%2FeBQcphHna9Cbj9EJpm85%2FScreenshot%202024-02-09%20at%2000.20.59.png?alt=media&#x26;token=4f59ed95-cbc1-4629-8fa8-39e28f273c66" alt=""><figcaption></figcaption></figure>

