Explainer video 5: "send mail"-block, subject line and subworkflows

Summary

This guide will walk you through the steps to create and debug a workflow in the Twin AI app. You'll learn how to test your workflow, handle errors, personalize email subject lines, and build sub-workflows to enhance functionality. This process ensures your workflows run smoothly and efficiently, saving you time and resources.

Debugging workflow errors

  1. Run the workflow: 
  • Click on "Run Workflow" to initiate your workflow.
  1. Check results: 
  • After running, navigate to the top right corner and click on "Results" to view the run status.
  • If the run fails, you'll see a failure message indicating an error in the workflow.
  1. View block results: 
  • Click on the "Transcribe" block.
  • Go to the "Output" tab and select "View Block Results" to see detailed information about the latest run.
  1. Identify the failing block: 
  • Repeat the previous step for the "Growth Potential" block to determine where the workflow failed.
  • If the last block is causing issues, focus your debugging efforts there.
  1. Add necessary identifiers: 
  • Consult with a technical colleague, refer to technical documentation in our helpdesk or contact us, to help fix the issue.
  • For example, add an ID to the attachment by:
  • Navigating to the attachment settings.
  • Entering the necessary ID in the designated field.
  • Clicking "Save" to apply the changes.

Publish and re-run the workflow

  1. Save and publish: 
  • After making the necessary changes, click on "Publish" to update your workflow.
  1. Run the workflow again: 
  • Click on "Run Again" to test the workflow with the updated settings.
  • Monitor the run to ensure it completes successfully.

Personalize email subject lines

  1. Add a prompt block: 
  • Click on "Edit" in your workflow.
  • Click the "+" button and select "Prompt Block".
  • Drag the prompt block to the desired location and create space as needed. Give it a proper name.
  1. Configure the prompt block: 
  • In the "Subject line of email" input field, enter your prompt, such as:

Write the subject line, summarize the development plan in three words. Include the name of the coach. Example subject line is: [example here].

  • Click "Save".
  1. Set prompt block settings ittems: 
  • Add the necessary settings items:
  • Development Plan.
  • Name of Coach.
  • Connect the data sources:
  • Development Plan: Connect to the right block output.
  • Name of Coach: Connect to the workflow input.
  • Click "Connect" for each data source to establish the connections.
  1. Link Blocks: 
  • Navigate to the "Send Mail" block.
  • Change the subject to the newly created "Subject Line of Email" block.
  • Click "Connect connect data source" to link the blocks.
  1. Publish and Test: 
  • Click "Publish" to save the workflow.
  • Click "Run Now" to execute the workflow.
  • Verify that you receive an email with a personalized subject line within a minute.

Verify the workflow execution

  1. Check your inbox: 
  • Check if you received the email. 
  • Open the email to review the subject line, e.g., "Strategy, Innovation, and Success".
  1. Review Email Content: 
  • Double-check the body of the email.
  • Verify that attachments are included correctly.
  • Make any necessary edits to the email content for clarity and presentation.

Creating sub-workflows for enhanced functionality

  1. Initiate a sub-workflow: 
  • In the main workflow, navigate to the left-hand side under the "Run" section.
  • Locate the "Workflow Block" and drag it into the workspace.
  • Connect the "Transcribe" block to the sub-workflow to maintain data input continuity.
  1. Rename the workflow block: 
  • Rename the workflow block to "Sub Talents".
  1. Create a new sub-workflow: 
  • Click on "Create" to start a new workflow within the sub-workflow block.
  • Name the new workflow, e.g., " Sub Talents".
  1. Configure the sub-workflow: 
  • In the "Talents" workflow, go to the "Input" tab.
  • Add the "Transcript" as input data by typing "Transcript" and pressing Enter.
  1. Connect data sources in the main workflow: 
  • Return to the main workflow and refresh the page.
  • Click on the "Workflow block" again.
  • Under "Input", select "Transcript" as the data source.
  • Click "Connect" to link the data source.
  1. Finalize the sub-workflow Setup: 
  • Click on "Open" to access the "Talents" sub-workflow.
  • Begin building the "Talents" chapter, ensuring the main workflow remains structured.

Full transcript

Testing the Workflow

Welcome back. I tested my workflow. When you add blocks, test your workflow every single step. It's not going to cost you a lot of money. I got an error on my workflow, so I can click on "Results" in the top right corner, and you can see that my run failed. But now I can show you how you can really track down what happens.

I can go to the "Transcribe" block, go to the "Output" tab, click on "View Block Results," and you can see that my latest run at 11:26 was actually done. I'm going to go back, go to "Growth Potential," click on "View Block Results" again. I can see that it is done. Spoiler alert: It is in the last block.

I asked Patrick, one of our main developers, what happens. Apparently, I have to add "ID" to the attachment. It's something that is useful in the technical world. If you have a technical colleague who is a developer or semi-developer, you might know that you have to add "ID" here. Click on "Save," "Publish," and "Run" again. I saved data to reuse in the future workshop test data to John Doe. The email address is mine, and the name of the coach is Patrick. Going to run now and hopefully, it works.


Adding a Personalized Subject Line

I'm happy to share that I indeed got results. You can see that the workflow is actually done. The subject line was still "Anything" because we added that to the subject line earlier. Now, we're going to add one small prompt block to make sure that every personal development plan gets a personalized or unique subject name.

Click on "Edit," click on the plus sign, and type "Prompt Block." Drag it to the right and create some space. This is the subject line of the email. Input: I'm going to stick to GPT-4 because it's a quite small prompt. Add a prompt, which I already prepared. Write the subject line, summarize the development plan in three words, include the name of the coach. Example subject line. Click on "Save."

I need to add the settings items as well. The development plan should be summarized in three words in the subject line. I need to add the development plan and the name of the coach. Click "Enter." We can connect the data source by development plan. Block output is obviously the development plan. Name of the coach is the input of the workflow because the coach will enter their name themselves. Click on "Connect."

Go back to the prompt. Write a subject line, summarize the development plan (connected), name of coach (connected), example subject line (connected). Click on "Save." I need to connect these two blocks to each other. Go to the "Send Mail" block. Subject is not "Anything" anymore. It is this block: "Subject Line of Email." Click on "Connect," "Publish," and "Run" again.


Testing the Updated Workflow

I saved some data to reuse in the future, so it's already there. I can click on "Run Now" and see what happens. See if I get a personal development plan with a unique subject line in my inbox in one minute. Going to test it out now.

I can go to my inbox, and I can see in the top line that, indeed, there it is. I received the concept version of the personal development plan at 11:57, which is just one minute after I started running the workflow. I can open the email and see the subject line: "Strategy, Innovation, and Success." I can see the Amplify sign. Insights with Patrick, with Patrick being the name of the coach that they fill in themselves. Then, underneath, you can see the body of the text. Obviously, you can edit this any way you like. You can see the attachments, which, like I said, is the concept version of the personal development plan.

Now, what we've built is that the coach can go to the form that you have published. They can fill in just three fields: the audio, the name of the coach, and the email address of the coach. One minute later, they receive a concept version of the personal development plan, while you spend maybe not even €0.10. I'm sure you cannot do it yourself for that amount of money.


Creating a Sub-Workflow

Imagine you have built this workflow, made it publicly accessible, and your clients and colleagues are going to use it. Then, suddenly, you get feedback from the coaches that the talent chapter should be much more elaborate. It has to be almost as big as this workflow as a whole. To keep this part clear and structured, I would recommend starting to build a sub-workflow to keep this part intact.

Go to the left-hand side, underneath the "Run" section, you can see the "Workflow" block. Click it and drag it over there. Obviously, connect the "Transcribe" block to the sub-workflow because that's still the input that we are going to use. Rename the "Workflow" block to "Sub Talents." Copy it because I'm going to need it later again.

Input: I can select a workflow that I already have in my account, or I can click on the "Create" button, which is what we're going to do now. And boom, there it is. Now I have a new workflow in which I can work to write the chapter "Talents."

Go to "General." It's called "Sub Talents." In the top bar, you can see this is the main workflow "Coaching Talk to Personal Development Plan," and underneath that, you have the sub-workflow. It's called "Talents." Click on the background of this workflow, go to the second tab "Input," and the input data is obviously the transcript. Type "Transcript," click "Enter," and you can see it's text.

Go back to the main workflow, refresh this page, and click on the "Workflow" block here again. Underneath "Input" in the "Workflow" block, I can select the "Transcript." Click on "Connect Data Source," "Transcript," and "Connect." Now, the "Transcribe" block is connected to the workflow. The workflow is called "Sub Talents." You can click on the "Open" button, and there you have a whole new workflow to basically start writing your talents chapter again. That is predominantly to keep this part intact as a whole. You can experiment in the sub-workflow, use this data, put it in the sub-workflow, and just start building again.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us