Automation Message Sources
A Message Source defines how ThinkAutomation will receive messages to process. You can create multiple Message Sources to receive messages from various sources. Each Message Source is connected to an Automation. When a message is received the message content is passed to the assigned Automation for processing. Individual Message Sources can be enabled/disabled or paused. You can also manually execute any Automation by sending it a message directly via the Studio or Desktop Connector.
To create a Message Source click the New Message Source button on the ThinkAutomation Studio ribbon. A Solution must have at least one Message Source.
Enter the Message Source Name and click Next to choose and configure the message source type:
Message Source Types
ThinkAutomation can receive and automate messages from the following Message Source Types:
Source | Details |
---|---|
Email - Office 365 | Read emails from an Office 365 or online Outlook account email folder. |
Email - Exchange | Read emails from a Microsoft Exchange account email folder. |
Email - Gmail | Read email items from a Gmail account. |
Email - IMAP | Read emails from an IMAP enabled email account. |
Email - POP3 | Read emails from a POP3 enabled email account. |
Email - SendGrid | Receive new emails received via SendGrid. |
Email - SMTP | Receive emails via the built-in SMTP mail server. |
Web Form | Create a local or publicly accessible web form and receive form submissions for processing. |
Web Chat | Create a local or publicly accessible web form with a conversation-style 'chat' UI. |
Teams | Respond to @mentions from Microsoft Teams channels. |
Database | Monitor a SQL database for new or updated records. |
MongoDB | Monitor a MongoDB collection for new documents. |
File Pickup | Monitor a local folder for new or updated files. |
CSV & Excel Pickup | Monitor an Excel or CSV file for new rows. |
HTTP Get | Monitor a web resource for changes. |
Azure Queue | Monitor an Azure Queue. |
Twilio | Receive incoming SMS messages from Twilio. |
Monitor a Twitter feed for new Tweets. | |
API | A HTTP API for receiving messages from custom sources and external webhooks. |
Web Forms - Custom | Post any of your existing web forms to ThinkAutomation for processing. |
Web Requests | Execute an Automation whenever the Web API URL is requested. |
Microsoft Graph Change | Monitor changes to various entity types in Microsoft Graph (Office 365). |
Static Scheduled | Execute an Automation with a default message at preset times. |
Email - Office 365 or Outlook
Reads emails from an Office 365 or an online Outlook mailbox folder. Click the Sign In button to sign in to an Office 365 or Outlook account.
Select the Folder to read emails from.
Enable the Delete Processed Messages option to remove emails from the Office 365 folder once they have been processed by ThinkAutomation (optional).
You can also select the Move To Folder option to move processed items to a different folder (optional). You can conditionally move processed messages to a different folder inside an Automation. See: Move Incoming Message action.
The Only Messages Since date entry allows you to specify a date. Any messages with a received date prior to this date will be ignored. The Only Messages From Address entry allows you to specify one or more from addresses. Leave this entry blank to include emails from all senders. You can specify multiple addresses separated by semi-colons. You can also use wildcards (eg: *@somedomain.com).
Access Shared Mailbox
You can optionally read messages from a shared mailbox. Enter the shared mailbox username in the Access Shared Mailbox entry. Click the Get Folders button to read the folders for the shared mailbox. If the Shared Mailbox entry is blank then folders will be displayed for the signed-in user.
Re-Sign In
Depending on your security configuration you may need to re-sign in periodically. In these cases ThinkAutomation will pause the Message Source and send a notification to the ThinkAutomation Studio informing you to sign in again. Open the Message Source using the ThinkAutomation Studio and click the Sign In button again and then Resume the Message Source.
Sync-Status
The Office 365 Message Source works by synchronizing changes since the last time the mailbox was checked (depending on the Schedule you have configured). Only new messages since the last synchronization are downloaded. All messages will be downloaded when the mailbox is accessed for the first time. During Automation development it may be necessary to re-download and reprocess all messages again. To do this, first delete all existing messages from the ThinkAutomation Message Store. Then click the Reset Sync State button on the Message Source properties page. The Reset Sync State button clears the synchronization status for the the message source causing all messages to be re-downloaded. See: Reprocessing Existing Messages.
Note: If the mailbox contains many thousands of messages it may take some time for the first sync to complete.
See Also: Microsoft Logins if you want to use your own App Registration for connecting to Office 365.
Email - Exchange
Reads emails using Microsoft Exchange Server Web Services (EWS). This works with any on-premises or hosted Exchange Server. Enter your Exchange User Name and Password and the URL and click Connect. If you do not know your Exchange URL, enter the User Name & Password and click Discover. This will attempt to find the URL from the user credentials.
Select the Folder to read emails from. Enable the Delete Processed Messages option to remove emails from the Office 365 folder once they have been processed by ThinkAutomation (optional).
You can also select the Move To Folder option to move processed items to a different folder (optional).
The Only Messages Since date entry allows you to specify a date. Any messages with a received date prior to this date will be ignored. The Only Messages From Address entry allows you to specify one or more from addresses. Leave this entry blank to include emails from all senders. You can specify multiple addresses separated by semi-colons. You can also use wildcards (eg: *@somedomain.com).
This Message Source type is designed for legacy on-premises or hosted Exchange Servers that still support basic auth. If you use Office 365 you should use the Office 365 Message Source which uses modern authentication.
Sync-Status
The Exchange Message Source works by synchronizing changes since the last time the mailbox was checked (depending on the Schedule you have configured). Only new messages since the last synchronization are downloaded. All messages will be downloaded when the mailbox is accessed for the first time. During Automation development it may be necessary to re-download and reprocess all messages again. To do this, first delete all existing messages from the ThinkAutomation Message Store. Then click the Reset Sync State button on the Message Source properties page. The Reset Sync State button clears the synchronization status for the the message source causing all messages to be re-downloaded. See: Reprocessing Existing Messages.
Email - Gmail
Reads emails from any Gmail mailbox. Click the Sign In button to sign in to Gmail. Select the Folder to download messages from.
Enable the Move Processed Messages To Folder option if you want to move emails to a different Gmail folder (optional). You can conditionally move processed messages to a different folder inside an Automation. See: Move Incoming Message action.
Enable the Delete Processed Messages option to delete emails once they have been processed by ThinkAutomation (optional). If the Permanently Delete option is enabled then emails will deleted permanently, otherwise they will be moved to the Trash folder.
The Only Messages Since date entry allows you to specify a date. Any messages with a received date prior to this date will be ignored. The Only Messages From Address entry allows you to specify one or more from addresses. Leave this entry blank to include emails from all senders. You can specify multiple addresses separated by semi-colons. You can also use wildcards (eg: *@somedomain.com).
Sync-Status
The Gmail Message Source works by synchronizing changes since the last time the mailbox was checked (depending on the Schedule you have configured). Only new messages since the last synchronization are downloaded. All messages will be downloaded when the mailbox is accessed for the first time. During Automation development it may be necessary to re-download and reprocess all messages again. To do this, first delete all existing messages from the ThinkAutomation Message Store. Then click the Reset Sync State button on the Message Source properties page. The Reset Sync State button clears the synchronization status for the the message source causing all messages to be re-downloaded. See: Reprocessing Existing Messages.
Email - IMAP
Reads emails from a mail server using the IMAP protocol. Enter the IMAP Server address, port, user name & password. Click the Connect button to connect and then select the Folder to read messages from.
You can select to Move or Delete processed messages (optional). You can conditionally move processed messages to a different folder inside an Automation. See: Move Incoming Message action.
If the Mark Processed Messages As Seen option is enabled, ThinkAutomation will set the 'seen' flag on the IMAP server for each processed message. It will also only download 'unseen' messages. This can improve performance, however you should ensure no other user is connecting to the same mailbox with the same credentials and marking messages as seen separately.
The Only Messages Since date entry allows you to specify a date. Any messages with a received date prior to this date will be ignored. The Only Messages From Address entry allows you to specify one or more from addresses. Leave this entry blank to include emails from all senders. You can specify multiple addresses separated by semi-colons. You can also use wildcards (eg: *@somedomain.com).
Sync-Status
The IMAP Source works by synchronizing changes since the last time the mailbox was checked (depending on the Schedule you have configured). Only new messages since the last synchronization are downloaded. All messages will be downloaded when the mailbox is accessed for the first time. During Automation development it may be necessary to re-download and reprocess all messages again. To do this, first delete all existing messages from the ThinkAutomation Message Store. Then click the Reset Sync State button on the Message Source properties page. The Reset Sync State button clears the synchronization status for the the message source causing all messages to be re-downloaded. See: Reprocessing Existing Messages.
Email - POP3
Reads emails from a mail server using the POP3 protocol. Enter the POP3 Server address, port, user name & password. Click the Test Connection button to verify the connection. You should only use POP3 if IMAP is not available.
POP3 is an older and slower protocol than IMAP and does not provide an option to only download new messages since the last download. To ensure fast access you should enable the Delete Processed Messages option so that messages are removed from the POP3 account once they have been processed by ThinkAutomation.
Email - SendGrid
The SendGrid message source type receives email messages sent to any of your SendGrid domains.
SendGrid is a cloud based message delivery platform. When used with ThinkAutomation it enables ThinkAutomation to receive email messages sent to any recipients for any of your SendGrid email domains. SendGrid is a worldwide platform and the cost is based on usage. See: https://www.sendgrid.com
You need to create a SendGrid Account if you want to be able to process SendGrid received email messages using ThinkAutomation.
You then need to login to your SendGrid account and setup the Inbound Parse feature. See: https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/
Set the Inbound Parse Webhook URL in your SendGrid account to the SendGrid Inbound Parse URL shown in the ThinkAutomation Message Source. As emails are received by SendGrid they will then be forwarded to ThinkAutomation for processing. This does not affect your regular SendGrid email flow - it simply sends a copy to ThinkAutomation as emails are received.
Email - SMTP
The SMTP message source type receives email messages via the built-in SMTP mail server. The ThinkAutomation server can be configured as a mail server to receive email directly.
In the Accept Incoming SMTP Emails For Addresses entry, enter one or more email addresses for this message source. Any incoming SMTP emails with a To, CC or BCC address matching one of these emails will be received and processed.
You can add multiple email addresses separated by semi-colons (;). Wild cards can be used (eg: sales*).
Multiple message sources can be configured to process different Automations depending on the To, CC or BCC addresses. If no Message Source is found for an incoming email then the email will be ignored.
Any email client, script or PowerShell can then be used to send email to ThinkAutomation for processing.
The SMTP Server option must be enabled in the Server settings. See: Server Settings - SMTP Server API
Web Form
The Web Form message source type enables you to create a local and publicly accessible web form with multiple input fields. Web forms are responsive and mobile friendly. Each web form has a unique secure public URL hosted on Azure as part of the ThinkAutomation Web API and a local URL served directly from your ThinkAutomation Server. You can embed the public web form inside your own website or send a link to the form in outgoing emails. When a web user completes the form, the results are sent to your ThinkAutomation Server for immediate processing. The Web Form can optionally display the Automation return value after the form is submitted.
Click here to view a sample webform.
Form Text
Title
Enter an optional title. This will appear in bold above the header.
Header Text
This is the text that is displayed above the form itself. You can use Markdown if required. The Markdown will be converted to HTML when the form is rendered. The Title & Header are optional. You can also adjust the text for the Submit Button.
Footer Text
The footer text defaults to 'Processed By ThinkAutomation'. If you have the ThinkAutomation Professional Edition you can change the Footer text. Set this to blank to remove the footer. The footer can contain HTML.
Confirmation Message
Enter the Confirmation Message. This is the text that is displayed after the form is submitted. If the Display In Modal Popup option is enabled then instead of the form content being replaced with the confirmation message, a popup window will show. When the user closes the popup window the form resets ready for new values.
If the Do Not Hide Form After Confirmation option is enabled, then the form will not be hidden after it is submitted. The confirmation message will be displayed and the submit button re-enabled. This allows the form to be submitted again without refreshing.
Side Pane
You can show custom content on the left or right side of the form. On the side pane tab, enable the Show Side Pane option. Select Right Of Form to show on the right-hand side of the form, otherwise it will show on the left. You can specify the number of Columns for the side pane. The total width is 12, so specifying 6 columns would mean the side pane is the same width as the form. The web form uses responsive layout, so if the side pane cannot fit on smaller devices, then it will automatically move below the form.
Any any text, Mark or HTML to display in the side pane area.
Using HTML
The Header, Footer, Confirmation and Side Pane message can use plain text, Markdown or HTML. Markdown will be converted to HTML. You can also use HTML directly. Web forms use Bootstrap 5, so any of the standard Bootstrap 5 classes can be used.
Form Input Fields
You can create any number of Form Fields. Click Add to add a field.
Enter a Name and Label Text. You can also optionally specify Help Text that will display in a smaller font below the input field.
The Field Type can be:
- Text
- Number (numeric only)
- Date
- Boolean (check box)
- HTML Editor (a full featured HTML editor - returns HTML)
- Email (only a valid email address allowed)
- URL (only a valid URL allowed)
- Telephone
- Password
- Decimal
- Currency
- Time
- Range
- Label (displays the label text only - does not return a value)
- Rating (user can select a rating by clicking Star icons)
- File (user can select a file to include with the form as an attachment)
For text field types you can specify the Max Length. The Max Lines option allows you to define the maximum lines.
You can arrange the order of fields on the form using the Up & Down buttons.
File Upload
You can add input fields of type File. This allows the user to select one or more files to upload. Uploaded files will be added to the incoming message as attachments. You can limit the allowed file types by specifying a comma separated list of allowed file extensions (or mime types) in the File Types entry.
For example:
.doc,.docx,text/plain
In the above example, the file upload will accept Word Documents and plain text files.
The value used in the file types entry will be used for the accept value of the file input type on the web form. If the File Types is blank then files of any type will be allowed.
You can also specify the maximum file size in bytes. If the Multiple option is enabled then the user will be able to upload multiple files in the same input. Enable the Required option if a file must be selected before the form can be submitted.
Field Attributes
The Attributes tab allows you to specify a default value, change case & validation rules. Enable the Validate option. When the web user completes the form they will not be able to submit it until all of the fields pass validation.
If you want the user to select possible values from a list, select the Must Be In List option and then enter the Choices. For example to show a list box showing 'Yes', 'No' & 'Not Sure', set the Field Type to 'Text', enable the Validate option, select the Must Be In List option and add Choices of 'Yes', 'No' and 'Not Sure'. The default value of the select list will be set to the Default Value entry. The list can be displayed as a select list, a button group or a radio button group. Select the display type from the Of Type entry.
Visibility
The Visibility tab allows you to define visibility rules for the current field. Disable the Visible On Form Load option if you do not want this field visible by default.
In the Change Visibility Of This Field grid you define a condition to show or hide this field. The condition can be based on values of other input fields.
Then from the If Condition Is True Make This Field entry select Visible or Hidden.
As a user completes the form all of the visibility conditions will be evaluated when any input value is changed.
Pre-Populating Field Values
In addition the the Default Value that you can set for each field you can also pre-populate field values via the form URL. Adding &x-{fieldname}=value
to the form URL will set its default value on form load. For example: If you have field name Company you could pre-populate its value by adding x-Company=Test%20Customer
to the form URL. Pre-populating field values can still be done if the field is hidden.
Scheme
The web form uses Bootstrap for its responsive layout. Select the Bordered option to show the form inside a bordered card. Use the Scheme list to select a color scheme for the card. You can also change the Background & Foreground colors. The Foreground color can only be changed if not using a bordered card. Specify a Header Image URL to display an image above the title.
You can also specify a Custom Style Sheet Link URL. You can use this to override the default Bootstrap styles. If a custom style sheet is used then the Background/Foreground colors are ignored.
Click the Preview button to display a local preview of how the form will look.
Redirect
You can optionally specify a Redirect URL. This is a URL the web user will be redirected to on completion of the form. If a redirect URL is specified then the Confirmation Message will not be displayed to the user. If you want to conditionally redirect after the confirmation message is show use the Create Web Form Redirect action.
WhosOn Live Chat
WhosOn is Parker Software's live chat and visitor tracking solution. See: https://www.whoson.com. If you are a WhosOn user you can add the WhosOn page tag to your form so that visitors to the form show in real time in your WhosOn Client. You can optionally Show Chat Button on your form. Your WhosOn Server & Domain details are specified in the ThinkAutomation Server Settings.
Captcha
You can add a Google reCAPTCHA box to your forms to ensure human only responses. Go to reCAPTCHA (google.com). Use the Admin Console to create a reCAPTCHA. Set the type to reCAPTCHA v2. In the domain enter api.thinkautomation.com. Select the reCAPTCHA keys section and enter your Site Key and Secret Key. You can also change the text that will be displayed if a user submits a form without first completing the Captcha.
Custom
You can optionally add any custom HTML on the Custom tab. This can contain JavaScript enclosed in <Script>
tags. Any custom HTML is rendered just before the closing </body>
tag. This can be used to set custom default values for form fields. For example, assume we have 'FromDate' and 'ToDate' input fields, and we want to set the default from date to two years before today and the to date to today:
<script>
const today = new Date();
const twoYearsAgo = new Date(today.getFullYear() - 2, today.getMonth(), today.getDate());
document.getElementById("FromDate").value = twoYearsAgo.toISOString().split('T')[0];
document.getElementById("ToDate").value = today.toISOString().split('T')[0];
</script>
Public Form URL
This entry shows the unique public URL for the web form. You can link to this from your website, send it in outgoing emails or embed it into your web site pages using an iframe tag. Whenever a web visitor completes the form the Automation assigned to the Message Source will be executed with the form contents.
Local Form URL
This entry shows the unique local URL for the web form. This URL connects directly to your ThinkAutomation Server and can be used on your local network. The local web form looks and operates the same as the Public web form except that the form contents are posted directly to your ThinkAutomation Server - bypassing the Public API.
Friendly Path
By default the URL path for the web form will be /form followed by ?taid={uniquekey}. You can change this to a more friendly path, such as /mycompany/customers/addform. The path must be unique. ThinkAutomation will check that the path is valid and unique before saving.
Returning The Automation Return Value
Enable the Wait For & Include Automation Return Value With The Confirmation Message option if you want the Automation Return Value included in the confirmation message. If this option is enabled then the form response will wait for the Automation to complete. You should then configure your Automation to return the text, markdown, html or a file that you want displayed in the form confirmation. The max wait time is 60 seconds, so if your Automation may be long running then the Wait For option may not be applicable.
You can also include a redirect in the Return value if you want another Web Form or URL shown after the form is submitted. See the Create Web Form Redirect action.
Returning Files
If the Wait For & Include Automation Return Value With The Confirmation Message option is enabled and the Automation Return value is a single local file path (or a variable containing a file path) then the file content will be read and returned. You can return whole html pages, images, PDF files etc. The response Content-Type will be set according to the file extension. The web form will redirect to a new page showing the file content.
Returning Files From The Embedded Files Store
If you are using the Embedded Files Store action to save files to the Embedded Files Store database, you can return file content directly from the Embedded File Store. Use the Embedded Files Store action with the Get Info operation. Assign the results of the Get Info operation to your Automation Return value. The ThinkAutomation Server will then read the file content directly from the database and return the content.
The Web API has a limit of 5mb for the content returned from an Automation.
Providing A Link To The Automation Results
If your Automation is long running, or you want to provide a static link to the Automation results that a user can access later, you can use the %Msg_ResultsUrl% variable. Your Automation could include this variable in an outgoing email. A user can click the link to view the Automation results at a later date. The %Msg_ResultsUrl% URL is unique for each processed message and contains a secure hash. The link will work for as long as the Message is stored in the Message Store. You do not need to enable the Wait For & Include Automation Return Value In The Confirmation Message option to use the %Msg_ResultsUrl%.
How it Works
When you save the Message Source your ThinkAutomation Server uploads the form details to the ThinkAutomation Web API Gateway server. The Web API Gateway acts as a secure tunnel between the public web form and your on-premises ThinkAutomation instance. Your ThinkAutomation server makes an outbound connection to the Web API Gateway server. Once saved, the web form can be used immediately. Any changes you make will be updated. See: Using The Web API for more information.
When a web user completes the form, the ThinkAutomation Web API sends the results to your ThinkAutomation Server. The message body will be Json containing the form fields. For example:
You can then use Extract Field actions to extract the data from the message and perform any other Automation actions. If your ThinkAutomation Server is not active when a web form is submitted it will be queued by the ThinkAutomation Web API for up to 48 hours. Any uploaded files will be added to the message as attachments.
Additional Headers
The following headers will be added to the ThinkAutomation message headers:
Header | Details |
---|---|
RemoteHost | The IP address of the web user submitting the form. |
User-Agent | The browser user-agent of the web user submitting the form. |
Origin | The origin header of the web user submitting the form. |
You can access these values in your Automations (using the Set Variable action with the Extract Header Value operation). The RemoteHost is available using the built-in variable %Msg_FromIp%. For example, you could use the GeoIP Lookup action to lookup the country for the user's IP address, or use the Get Browser Info action to get the browser name.
Security
Each web form URL is unique to your ThinkAutomation instance and Message Source and contains a secure hash. The web form is hosted on Microsoft Azure and is served via HTTPS only - meaning all form submissions are encrypted. The ThinkAutomation Web API sends completed forms to your ThinkAutomation Server over a secure WebSocket connection. The Web API gateway server does not keep copies of submitted forms. If your ThinkAutomation Server is not active then any form data is stored in a queue for up to 48 hours and sent when your ThinkAutomation Server becomes active. This storage queue is encrypted.
Embedding The Form In Your Website
You can add the form to any of your web pages using an iframe tag. For example:
<div class="container-sm pt-4">
<div class="row">
<div class="col-7 mx-auto">
<div class="card">
<iframe style="height:900px;border:0;padding:0;margin:0;" title="Reseller Form" src="https://api.thinkautomation.com/form?taid=5033f425cf79df15d03275fa6220954590ca1c720cc0959dAIXShPj1fv5f0Vnr9dFg2Zlc%2bQgXEi%2fS"></iframe>
</div>
</div>
</div>
</div>
Once the form is embedded any changes you make to Message Source Web Form properties will be updated on the form on your site. If you delete the Message Source from your ThinkAutomation settings you will need to remove the embedded link from your site.
You can also post your own existing web forms to ThinkAutomation for processing. See: Web Forms-Custom.
Web Chat
The Web Chat message source type enables you to create a local and publicly accessible web chat form. Each web chat form has a unique secure public URL hosted on Azure as part of the ThinkAutomation Web API and a local URL served directly from your ThinkAutomation Server. You can link to, or embed the public web chat form inside your own website or send a link to the form in outgoing emails. When a web user sends a chat message, the results are sent to your ThinkAutomation Server for immediate processing and the Automation Return Value is returned to the chat. The user can continue sending messages and receiving responses in a conversation-style UI. Any number of separate Web Chat Form message sources can be created.
Bot Name
Specify the name for your 'bot'. When ThinkAutomation sends back a response the Bot Name shows above the response text in the chat. You can use an email address in the form Bot Name <email>
. The bot name shown in the chat form will just be the name part. The Bot Name is also used for the 'To' address of messages sent from the Web Chat form to your ThinkAutomation server and available in your Automation in the %Msg_To% variable.
Start Chat
Before a user starts a chat session you can optionally require that the user enters their Name, Email Address and/or a Subject. These values will be passed to your Automation with each chat message in the %Msg_FromName%, %Msg_FromEmail% and %Msg_Subject% variables.
You can configure the input fields for Name, Email & Subject (such as Prompt text, Required etc.). For the Subject field, if you want to provide a list of possible values instead of free-text, set the Attributes of the Field to Validate - Must Be In List - and then provide the Choices.
You can also pre-populate the Name, Email & Subject field values via the chat form URL. Adding &x-Name=value
, x-Email=value
and x-Subject=value
to the chat form URL will set the values on form load.
You can change the Start Chat Header text. This is any text that appears above the Start Chat input fields. You can also change the Start Chat Button Text.
Send Token On Chat Start
If this option is enabled then your Automation will receive a message with the %Msg_Body% set to [webchatstart]
after a user has completed the Start Chat form to initiate a new chat session. Your Automation could check for this token and return details about what your bot can offer and any other opening remarks. You can also use this to record user details in a database etc. Your Automation should return blank Return Value if you do not want any response returned to the chat after receiving this message.
Initial Message
After the user completes the Start Chat form and starts a new chat session an Initial Message can be added to the chat. This would normally be a Welcome! How can we help you today? style message. You can use Markdown or HTML if required. Set to blank for no initial message.
File Upload
Enable the Allow File Upload option if you want to allow the user to upload files during the chat. The uploaded file will be added as an attachment to the incoming message. The Allowed File Extensions entry allows you to specify the allowed file types. Specify a comma separated list of allowed file extensions (eg: pdf,doc,docx). You can also specify the Maximum File Size in bytes.
Labels
You can change the Header text and the Message Text Placeholder. The header is displayed above the chat form.
Footer
The footer text defaults to 'Processed By ThinkAutomation'. If you have the ThinkAutomation Professional Edition you can change the Footer text. Set this to blank to remove the footer. The footer can contain HTML.
Theme
Specify a Light, Dark or one of the color themes. You can also optionally specify a Header Image URL. This is the URL to a image that will show in the chat header. This should be a small image (32/32 pixels).
Click the Preview button to display a local preview of how the chat form will look.
Note: Parker Software Professional Services can create bespoke web chat forms with custom styling. Please contact us for more information.
Public Chat URL
This entry shows the unique public URL for the web chat form. You can link to this from your website, send it in outgoing emails or embed it into your web site pages using an iframe tag.
Local Chat URL
This entry shows the unique local URL for the web chat form. This URL connects directly to your ThinkAutomation Server and can be used on your local network. The local web form looks and operates the same as the Public web chat form except that the form contents are posted directly to your ThinkAutomation Server - bypassing the Public API.
Friendly Path
By default the URL path for the web chat form will be /form followed by ?taid={uniquekey}. You can change this to a more friendly path, such as /mycompany/customers/chat. The path must be unique. ThinkAutomation will check that the path is valid and unique before saving.
How it Works
When you save the Message Source your ThinkAutomation Server uploads the chat form details to the ThinkAutomation Web API Gateway server. The Web API Gateway acts as a secure tunnel between the public web form and your on-premises ThinkAutomation instance. Your ThinkAutomation server makes an outbound connection to the Web API Gateway server. Once saved, the web chat form can be used immediately. Any changes you make will be updated.
When a web user sends a chat message, the ThinkAutomation Web API sends a new message to your ThinkAutomation Server. Your Automation will execute for each chat message received. The message body %Msg_Body% variable will contain the user entered message text.
Returning The Automation Return Value
Web Chat forms will automatically wait for your Automation to execute. The Automation Return Value will be displayed in the chat as a response to the message received. You should configure your Automation to return the text, markdown or HTML you want displayed in the chat in response to the message received.
You can also include a redirect in the Return Value if you want the chat session to end and be redirected to another Web Form, Chat Form or URL. See the Create Web Form Redirect action.
Sending '[end]' as the Automation Return Value will end the current chat session for the user.
Sending Chat Input Request Forms
In addition to returning text in the Automation Return Value, you can send 'Chat Input Request' forms. This is a pre-defined list of buttons or inputs that the user can complete to send back specific information.
For example, you could ask the user 'Which product do you use?' and then include buttons for each of your products. The user can simply click one of the buttons instead of typing the product name. See: Create Chat Input Request action.
Integrating With AI
The Automation executed when a chat message is received can perform any actions you choose. You could return on-premises or company data based on the message text received. You can also call ChatGPT, Grok or OptimaGPT using the Ask AI action. Using the Ask AI action enables you to very quickly create website chat bots - especially when combined with the Embedded Knowledge Store action to provide context.
A simple AI enabled Chat Bot Automation example:
In this example, we have loaded all of the ThinkAutomation help documentation into the Embedded Knowledge Store collection called 'ThinkAutomationKB'. When a user asks a question in the chat, the Automation searches the Knowledge Base using the user's question to find the 5 most relevant articles. Those are then added to the conversation as context. This enables the AI to answer the question - even if it has no knowledge itself.
When you create a new Web Chat Message Source, the New Message Source wizard will ask you if you want to use AI with a Knowledge Store. If this option is enabled, a new Automation will be automatically created and your bot will be ready. You can then edit the Automation if you need to make adjustments.
The integration of ThinkAutomation with AI offers a powerful workflow automation solution that enhances the capabilities of AI through on-premises operation and context enrichment from a local knowledge store. This approach enables accurate, context-aware responses without the need for model training, ensuring cost-effectiveness and the ability to keep private data secure. It allows organizations to quickly create working bots, maintain up-to-date information, and harness the full potential of AI while maintaining control over their data and data privacy.
Microsoft Teams
The Teams message source type receives outgoing webhook requests from Microsoft Teams. Users of Teams can use @mentions to trigger a request. Your Automation return value is then sent back to the conversation as a response.
For each Teams Message source you supply a Name. This is the text that users will type in Teams (preceded by an @ sign). For example: You could have a Teams Message Source with the name 'FindCustomer'. In Teams users would type @FindCustomer followed by some more text. When the user hits enter the text will be sent to ThinkAutomation and your Automation will execute. The Return value of the Automation will then be sent back to Teams and show as a response in the conversation.
You can create any number of Teams Message Sources with different 'names' and then attach these to any of your Teams.
Setup In Microsoft Teams
In Microsoft Teams select the appropriate team and choose Manage team from the (•••) drop-down menu.
Select Manage Team
Choose the Apps tab from the navigation bar.
Select Create an outgoing webhook.
Note: This option will only be available if you are the Owner of the team.
Specify the Name - users can then enter @{name} to send to ThinkAutomation.
Paste the Microsoft Teams Outgoing Webhook Callback URL into the Callback URL entry.
Paste the Security Token shown after the Teams webhook is created into the Security Token entry in ThinkAutomation.
See: Add custom bots to Microsoft Teams with outgoing webhooks - Teams | Microsoft Docs for more information.
When you create a new Teams message source, ThinkAutomation will automatically add Extract Field actions to the Automation to extract the message text.
Returning A Response
Use the Return action to send back the text you want to respond with. The response text can be plain text, HTML or Markdown.
An Example: You could create a Teams outgoing webhook with the name "GetAccount". Whenever a Teams user types '@GetAccount Test Customer' - your Automation will execute. The %MessagePlainText% Extracted field will be set to 'GetAccount Test Customer'. The %MessageTextAfterName% Extracted Field will be set to 'Test Customer'. You could then lookup customer details from a database or perform other actions and return a response - which will be returned back to the Teams conversation.
You could also use the Ask AI action with a local knowledge store. This would allow teams users to send questions to your 'bot'.
Returning An Adaptive Card
You can also return an Adaptive Card. This is Json text that will be rendered in Teams. You can design Adaptive Cards here: https://adaptivecards.io . Once you have designed your Adaptive card click the Copy card payload button to copy the Json text. Use this as the Automation Return value. You can adjust the Json to include Automation %variables% before returning it using the Create Json action.
The Automation you execute should not be long running. Microsoft Teams will wait for up to 5 seconds for a response.
The Microsoft Teams message source type uses the ThinkAutomation Web API to forward messages from Teams to your ThinkAutomation Server. The ThinkAutomation Web API sends messages to your ThinkAutomation Server over a secure WebSocket connection. The Web API server does not keep copies of forwarded messages.
Database
The Database message source type can be used to monitor a database for new or updated records. Rows returned from a database query will be passed to an Automation for processing. Select the Database Type (Microsoft SQL Server, MySQL, SQLite, Oracle, PostgreSQL, DB2, Firebird or OLDBC/OLEDB). Enter the Connection String or click the ...
button to build and test the connection. See: Database Connection Notes for more details about supported databases.
Enter the SQL Statement to query against the database to retrieve rows. For example:
The SQL Statement can contain Parameters. You should then complete the Parameters table to provide each parameter type and value.
The query should include at least one column that provides a unique value. Enter this column name in the Unique Id Column box. ThinkAutomation will ensure that the same record is not processed more than once based on the Unique Id Column value. If no Unique Id Column is used then the same records could be processed multiple times if they are not filtered out using the WHERE clause (or deleted).
ThinkAutomation automatically caches the last Unique Id Column value each time it requests data from the database. You can use this cached value as a Parameter value by setting a parameter value to %LastDatabaseId%.
In the above example the Unique Column Name is PersonId. We set the @Id parameter value to %LastDatabaseId%. This means that each time ThinkAutomation requests data from the database it only requests records with a higher PersonId since the last request (making the query much faster).
Test & Create Automation
You should test your query before saving the Message Source. Click the Test button. When you use the Test option on a new Message Source, ThinkAutomation will ask if you want to create a new Automation to process the records. It will then create a new Automation with Extract Field actions that match the columns returned by the query.
Creating The ThinkAutomation Message
Each row returned from the database query will be passed to the Automation for processing. You can choose to pass all columns to the Automation or a single column. Set the Assign All Columns To Message Body to send all columns returned by the query.
The database row will be passed to the Automation in the following format:
{
"PersonId": 1,
"PersonType": "EM",
"NameStyle": false,
"Title": "",
"FirstName": "Ken",
"MiddleName": "J",
"LastName": "Sánchez",
"Suffix": "",
"EmailPromotion": 0,
"AdditionalContactInfo": "",
"ModifiedDate": "2009-01-07 09:00:00"
}
If you used the Test option then Extract Field actions will have been created automatically to extract each column value.
You can optionally set the message Subject, From Address and Date. The Subject will default to '%TableName% (%LastDatabaseId%)' - where %TableName% will be the table name extracted from the SQL statement used for the query. You can change this and include text and column values for the current row. To use column values, use %ColumnName% replacements. For example:
Record Id %LastDatabaseId% For %FirstName% %LastName%
would set the subject to 'Record Id 1 For Ken Sánchez'.
The Message Date will default to the current date & time. You can optionally set it to a column value. For example, %ModifiedDate%.
MongoDB
The MongoDB message source type can be used to monitor a MongoDB database collection for new or updated documents. Each document found will then be passed to an Automation for processing. You can connect to a local MongoDB or a cloud based MongoDB compatible document database such as MongoDB Atlas, Amazon DocumentDB or Azure Cosmos DB.
Enter the MongoDB Connection String, Database Name and Collection Name. Enter the Query json and optionally the Projection and Sort json. Click the Test button to test the connection and query.
ThinkAutomation automatically caches the last document _id value between requests in the %LastDatabaseId% variable. This can be used in the Query json. For example:
This Query will retrieve all documents where the _id value is greater than then last requested _id.
Each document returned from the query will be passed to the Automation for processing in its Json format. You can then create Extracted Fields on your Automation to extract each value that you need in your Automation. Extracted Fields have an Extract Json option for easy extraction of Json data.
File Pickup
The File Pickup message source type can be used to monitor a local folder on the ThinkAutomation computer. Each new or updated file found in the folder will be passed to the Automation for processing. The Subject of the message will be set to the file path.
Select the From Folder and File Name or Mask.
Add File Contents
Enable the Add File Contents option if you want ThinkAutomation to add the file contents to the message passed to ThinkAutomation for processing. Text based files will be added as the plain text body. HTML files will be added as the HTML body. Any other files will be passed as an Attachment - which you can then process in the Automation. The Add File Contents option applies only to files less than 50MB in size. For files greater than 50MB the file details will be passed (see below).
Add File Contents - Email Messages
Files with extensions .eml and .msg (Outlook Messages) will be added as regular email messages (with Body, Subject, From, To, Headers etc set.).
No File Contents
If Add File Contents is not enabled (or the file size > 50MB) then only the file details will be passed to the Automation. The file details are passed as Json in the Message Body, in the following format:
{
"Path": "D:\\Setup Files\\ThinkAutomation.exe",
"Name": "ThinkAutomation.exe",
"Extension": "exe",
"Size": 167815264,
"Created": "2020-11-20 14:58:02",
"Modified": "2020-11-20 14:58:05",
"Description": "ThinkAutomation Installer",
"CompanyName": "Parker Software",
"Version": "5.0.261.2",
"Product": "ThinkAutomation"
}
The Subject will be set to the file path.
In an Automation you can then access the file path using %Msg.Subject% and extract other file information using Extract Field actions. The default Automation created when you create the Message Source will automatically contain Extract Field actions to extract the above fields. You can then use the %Path% variable on Automation actions (such as Convert Document, Print etc).
Delete After Pickup
Enable the Delete After Pickup option if you want ThinkAutomation to delete files once they have been processed.
Enable Folder Monitoring
If the Enable Folder Monitoring option is enabled then ThinkAutomation will monitor the selected Folder for new or changed files (after the initial scan). New and changed files will be processed immediately. If this option is not enabled then you can set a Schedule (for example: Every 2 minutes). The folder will scanned depending on the schedule - and any new files will be processed. Folder monitoring is enabled by default - you can disable it if you only want to scan a folder at pre-set times.
CSV and Excel Files
When using the File Pickup message source type, CSV and Excel files can be treated differently. Instead of the complete file, ThinkAutomation can select any new Rows added to the CSV or Excel file and send these as single messages to the Automation for processing.
For Example, consider the following CSV file:
Product | Name | Quantity | Value |
---|---|---|---|
Item 1 | Item 1 description | 100 | 1.20 |
Item 2 | Item 2 description | 200 | 1.30 |
When ThinkAutomation reads this CSV file (or Excel file) it will create 2 messages in the following format:
Message 1:
{
"xName": "items.csv",
"xRow": 1,
"Product": "Item 1",
"Name": "Item 1 description",
"Quantity": 100,
"Value": 1.20
}
Message 2:
{
"xName": "items.csv",
"xRow": 2,
"Product": "Item 2",
"Name": "Item 2 description",
"Quantity": 200,
"Value": 1.30
}
The subject of the message will be: [filename] Row x
Enable the For CSV & Excel Files Create Single Messages For Each New Row option to enable single row message processing. For Excel files you can also optionally specify the Worksheet name to use and the Headers Row number containing header values.
For CSV files, if the CSV file has no header row, enable the CSV Has No Header Row option.
By default all columns in the CSV or Excel file will be passed to the Automation. If you only need certain column values enable the Read Values From Specific Columns option and then specify a list of Column Headers or Column Numbers.
Creating Extracted Fields For CSV & Excel Files
When using single row processing ThinkAutomation can create the Extract Field actions for you. Click the Create Extracted Fields button. ThinkAutomation will then read the CSV or Excel file specified in the File Name entry and create an Extract Field action for each column.
Resetting The Last Row Pointer
Each time ThinkAutomation reads the CSV or Excel file for new rows, it stores the last row number in the Message Store database, so only new rows since the last scan are processed. During testing you may need to reset this to allow a new full scan. To reset the pointer, click the Reset Last Rows button.
Monitor Web Resource
The HTTP Get message source type reads the response from any URL. If the response content has changed the content will be passed to an Automation for processing.
Specify the Get URL
If the web page requires a login specify the credentials in the Authentication section.
If the URL returns HTML the HTML content can be converted to plaintext or XML. The converted text will then become the message body of the message passed to the Automation. Json responses will be passed unchanged.
Any other content-types will be passed as an Attachment.
If the HTTP Get fails you have the option to:
- No Action.
- Set the Message content passed to the Automation to the HTTP status (eg: 404 File Not Found).
- Pause the Message Source
Each time the HTTP content is read ThinkAutomation will compare the response to the last received response. If the response has changed a new message will be added for processing.
Some websites prevent automated tools from reading web content, so this Message Source type may not work in all cases. Its primary use is for monitoring HTTP API's or web resources that allow automated access.
Monitor Azure Queue
The Azure Queue message source type can be used to monitor a Microsoft Azure queue for new messages.
Enter your Azure Queue Account Name & Access Key.
Enter the Queue Name.
Click the Verify button to verify that ThinkAutomation can read from the queue.
ThinkAutomation will read each message from the queue and use the message contents as the message body. You can then parse the contents and perform Automation actions.
Enable the Delete Messages option to remove messages from the Azure queue after being read by ThinkAutomation.
If you do not delete messages, then you should specify the Visibility Timeout value. This is the number of seconds that the message should be invisible to other clients after it has been read. It is then assumed another client will delete the messages at a later date.
Twilio
The Twilio message source type receives SMS text messages sent from any mobile phone to any of your Twilio phone numbers.
Twilio is a cloud communications platform. It enables developers to programmatically make phone calls and to send & receive text messages using its web API's. When used with ThinkAutomation, it enables ThinkAutomation to receive SMS messages. Twilio is a worldwide platform and the cost is based on usage.
See: https://www.twilio.com
You need to create a Twilio Account if you want to be able to process received SMS text messages using ThinkAutomation. In Twilio, create a Twilio Phone Number to receive messages. In the Twilio Phone Number Properties set the Messaging - A Message Comes In - Webhook URL to the Set Your Twilio Messaging 'A Message Comes In' Webhook URL To shown in the ThinkAutomation Message Source properties.
Once assigned, any SMS messages sent to your Twilio number will be sent to ThinkAutomation for processing. You can create different ThinkAutomation Message Sources and assign each Webhook URL to each of your Twilio Phone numbers, or you can use a single ThinkAutomation Message Source and assign the same URL to all of your Twilio Phone Numbers and then parse the 'To' number out of the received message.
When a SMS message is received ThinkAutomation will create a new message that can be processed by your Automations. The message will be in the following format:
{
"from": "+447799123456",
"fromCountry": "GB",
"fromCity": "",
"fromState": "",
"fromZip": "",
"to": "+447779678901",
"toCountry": "GB",
"toCity": "",
"toState": "",
"toZip": "",
"smsStatus": "received",
"body": "Test SMS Message Received",
"numMedia": "0",
"numSegments": "1",
"messageSid": "SMe0000000000000000000000000000000",
"accountSid": "AC00000000000000000000000000000000",
"apiVersion": "2010-04-01"
}
You can then parse this message and perform Automation Actions, such as sending an outgoing SMS replies or recording the message details in a database.
When you create a Twilio Message Source using the New Message Source Wizard an Automation will be automatically created with Extract Field Actions setup to extract the above data.
You can reply to the incoming SMS using the Twilio Send SMS Message action and setting the To value to the %from% extracted field value. The %body% extracted field value will contain the incoming message text.
The Twitter message source type reads tweets from a Timeline, @mentions feed or for any search term. This Message Source is useful for monitoring your own (or another business) Twitter feed and performing actions if certain words appear in Tweets.
Requires a paid Twitter Basic or Pro level developer account. See: Twitter Developer Portal
From the Read Tweets For list select one of:
Type | Details |
---|---|
User Timeline | Reads new tweets for any Twitter user. Enter the Twitter Handle (you don't need to enter the @ sign). The Twitter handle can be found by opening a Twitter users feed. |
User Mentions | Reads new tweets that mention the specified Twitter Handle. |
Search Term | Reads new tweets that match the specified Search Term. |
For Search Term queries you can select to Exclude Replies and/or Retweets.
When a new Tweet message is received ThinkAutomation will create a new message that can be processed by your Automations. The message will be in the following format:
{
"author_id": "1629799226",
"created_at": "2021-11-24T09:21:05+00:00",
"id": "1463437507513798656",
"text": "Test tweet",
"lang": "en",
"name": "Parker Software",
"username": "ParkerSoftware"
}
You can then parse this message and perform Automation Actions.
When you create a Twitter Message Source using the New Message Source Wizard an Automation will be automatically created with Extract Field Actions setup to extract the above data.
When a new Twitter Message Source is created, ThinkAutomation will read the most recent 200 Tweets. From then on it will read new Tweets as they are added. You can reset the Sync status by clicking the Reset Sync State button. The most recent 200 tweets will then be processed again (provided they have been removed from the Message Store).
Note: You will need to create your own Twitter Developer account with Basic or Pro level access. The free tier cannot be used.
API
The API Message Source type allows you to receive messages to process via local or public HTTP POST or GET requests. You can also use this Message Source type if you only want to manually execute Automations, without any specific source.
Local API URL
Messages can be posted to ThinkAutomation via a local API URL. Each Message Source has a unique local API URL. You can use this endpoint to post messages within your local network.
See Also: Using The Local API
Public API URL
Messages can also be posted to ThinkAutomation via a public API URL. The Web API provides a secure web public endpoint allowing messages to be posted to ThinkAutomation from your own or 3rd party webhooks. Each Message Source has a unique public API URL. The public Web API Gateway acts as a secure tunnel between web resources and your on-premises or self-hosted ThinkAutomation instance. This allows your ThinkAutomation Server to receive public HTTP requests without being publicly accessible itself.
See Also: Using The Web API
Create Extracted Fields
If you will be receiving Json via HTTP POST or GET requests you can quickly create the required Extract Field actions. Click the Create Fields button and paste a sample of the Json you will be receiving. The required Extract Field actions will then be created in your Automation.
Advanced Settings
These settings are optional.
Allowed Methods
By default the API Message Source will accept both HTTP POST and GET requests. You can limit to POST or GET only.
Require Authentication
By default, callers to the API endpoint do not need to supply any authentication. You can require the caller to provide authentication. This can be an API Key, a Bearer Key or Basic Authentication.
For API Key authentication you specify the header name and value. The caller must add the required header to their requests.
For Bearer Key authentication the caller must add an 'Auth' header with the value Bearer: {value}.
For Basic authentication the caller must add an 'Auth' header with the value Basic: {base64encoded username:password}.
Any request with invalid authentication will be refused with a 401 Unauthorized response.
Allowed Origins
For the public API you have the option of specifying Allowed Origins. Specify a comma separated list of allowed URL's that can post to the public API endpoint. If this entry is blank then the endpoint can be posted to from anywhere. Full URL's should be specified, eg: https://www.mysite.com
- without any path or page name.
Disable
You can explicitly disable the Message Source from receiving public API requests by enabling this option. Any requests to the Public API endpoint will then receive a 404 response.
Friendly Path
By default the URL path for the Message Source will be /addmessage followed by ?taid={uniquekey}. You can change this to a more friendly path, such as /mycompany/customers/add. The path must be unique. ThinkAutomation will check that the path is valid and unique before saving.
Web Forms - Custom
The ThinkAutomation Web API can accept HTTP POST requests from your own web forms. Simply set the form action to the public API URL. For example:
<html>
<body>
<form action="https://api.thinkautomation.com/addmessage?taid=5f7b421a6e1f408c38488397179ab14c6e1f405c7cbf955cd9%2fwxO9qltjQwt0pU7d4GRErBl5njQP%2f" method="post">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
You can add a &redirect={URL} parameter to the API URL query string if you want the server to respond with a 303 Redirect once the message has been accepted.
When the form is posted to ThinkAutomation a new message will be sent to your Automation in Json format. For example:
The RemoteHost, User-Agent & Origin headers will also be added to the ThinkAutomation message headers. The RemoteHost can be accessed using the built-in variable %Msg_FromIp%. You can access these values in your Automation using the Set Variable action with the Extract Header Value operation.
You can then use Extract Field actions to extract the data from the message and perform any other Automation actions. If your ThinkAutomation Server is not active when a web form is submitted it will be queued by the ThinkAutomation API for up to 48 hours.
Returning Automation Results
By default API POST requests will respond with a 202 Accepted status as soon as the message has been queued (unless a &redirect parameter is specified). You can optionally wait for the Automation results by adding &wait=true or &results=true query string parameter to the URL.
If &wait=true is used the API will return the results of the Automation in the MessageResultDetail object of the Json response along with a 200 OK status. The response will include the Automation return value.
If the &results=true parameter is used then only the Automation Return Value content (or an error message) will be returned along with a 200 OK status. Depending on the content of the Automation Return value, the result will be served as plain text (text/plain), HTML (text/html) or Json (application/json). If the Return Value contains Markdown text it will be converted to HTML first. If the Return Value is already HTML it will be returned as HTML. If the Return Value is Json it will be returned as Json.
Providing A Link To The Automation Results
If your Automation is long running, or you want to provide a static link to the Automation results that a user can access later, you can use the %Msg_ResultsUrl% variable. Your Automation could include this variable in an outgoing email. A user can click the link to view the Automation results at a later date. The %Msg_ResultsUrl% URL is unique for each processed message and contains a secure hash. The link will work for as long as the Message is stored in the Message Store.
For additional security, ensure the Allowed Origins entry on the Message Source API properties contains the URL for the site containing the forms you will be posting to ThinkAutomation. This will ensure that form posts will only be accepted from your own website.
Web Get Requests
The ThinkAutomation public API URL also accepts HTTP GET requests. You can specify the message content as part of the URL. Whenever the URL is requested a new ThinkAutomation message will be created and processed.
The body, subject, from & to addresses can be specified on the query string:
https://api.thinkautomation.com/addmessage?taid=5f7b421a6e1f408c38488397179ab14c6e1f405c7cbf955cd9%2fwxO9qltjQwt0pU7d4GRErBl5njQP%2f
&from=alice%40test.com
&subject=unsubscribe
&body=testmessage
The body, subject, from and to query string parameters are optional.
You can add a &redirect={URL} parameter to the API URL query string if you want the server to respond with a 303 Redirect once the message has been accepted.
Passing Field/Value Pairs
You can also pass specific field values using x-fieldname=value
. In this case the message passed to ThinkAutomation will be in Json format with each field value (excluding the 'x-').
For example:
https://api.thinkautomation.com/addmessage?taid=5f7b421a6e1f408c38488397179ab14c6e1f405c7cbf955cd9%2fwxO9qltjQwt0pU7d4GRErBl5njQP%2f
&from=alice%40test.com
&subject=unsubscribe
&x-name=Alice+Bamber
&x-email=alice%40test.com
The message body which would be sent to ThinkAutomation as:
If you do not want to use field=value pairs you can pass the raw body text using the &body=
query string parameter. The ThinkAutomation message body will be set to the contents of the body parameter with no conversion.
The RemoteHost, User-Agent & Origin headers will also be added to the ThinkAutomation message headers. You can access these values in your Automation using the Set Variable action with the Extract Header Value operation.
You can then use Extract Field actions to extract the data from the message and perform any other Automation actions. If your ThinkAutomation Server is not active when a web request is made it will be queued by the ThinkAutomation API for up to 48 hours.
Returning Automation Results
By default API GET requests will respond with a 202 Accepted status as soon as the message has been queued (unless a &redirect parameter is specified). You can optionally wait for the Automation results by adding &wait=true or &results=true query string parameter to the URL.
If &wait=true is used the API will return the results of the Automation in the MessageResultDetail object of the Json response along with a 200 OK status. The response will include the Automation return value.
If the &results=true parameter is used then only the Automation Return Value content (or an error message) will be returned along with a 200 OK status. Depending on the content of the Automation Return value, the result will be served as plain text (text/plain), HTML (text/html) or Json (application/json). If the Return Value contains Markdown text it will be converted to HTML first. If the Return Value is already HTML it will be returned as HTML. If the Return Value is Json it will be returned as Json.
Providing A Link To The Automation Results
If your Automation is long running, or you want to provide a static link to the Automation results that a user can access later, you can use the %Msg_ResultsUrl% variable. Your Automation could include this variable in an outgoing email. A user can click the link to view the Automation results at a later date. The %Msg_ResultsUrl% URL is unique for each processed message and contains a secure hash. The link will work for as long as the Message is stored in the Message Store.
See: Using The Web API
Microsoft Graph Change
This message source type synchronizes changes to various entity types in Microsoft Graph (Office 365/Azure Active Directory). A new message will be processed whenever an entity is created, updated or deleted.
Currently the following entity types can be tracked:
- Calendar Events : For the logged in user or another username.
- Organization Contacts : Contacts managed by administrators.
- Users : Organization users.
- Teams Channel Chat Messages : For monitoring a Microsoft Teams channel.
More entity types will be added in the future.
Select the Entity Type. Then click the Sign In button to sign in with your Office 365/Microsoft Azure account.
For each entity type ThinkAutomation synchronizes changes. For new message sources all existing entities will be read - from then on only new/updated or deleted entities will be read. A new message will be created for each entity returned.
The message passed to ThinkAutomation for processing will be in JSON format representing the entity. When a new Message Source is created a new Automation will be created with extracted fields to extract the most common properties.
Static Scheduled
This message source type is useful if you simply want to run an Automation at a preset schedule without a specific incoming message. It enables you to execute an Automation based on the Schedule (for example, every 10 minutes). It uses a static default message (that can be blank).
At the scheduled time a new message is added to the process queue. The Automation assigned to the Message Source will be executed.
Message Source Schedules
Message Sources can be assigned a Schedule. This defines how often the Message Source should be checked for new messages. Schedules can be every x seconds, minutes or hours, or at specific times. You can also select the days of the week that the Message Source should be active (and active from and to times for each day). Select the Schedule tab on the Message Source properties page to edit the schedule. A default schedule will be created for new Message Sources if required.
If a Message Source has a schedule then new messages will be checked based on the schedule settings. You can force a Message Source to check for new messages, regardless of its schedule. Right-click a Message Source and select 'Run Now'. The Message Source will check for new messages immediately and then revert back to the schedule.
Web Form, File Pickup, SendGrid, Twilio, Teams, SMTP and API message source types do not need a schedule. Any new messages for these Message Source types will be processed immediately.
Message Source General Properties
A number of additional properties can be set for each Message Source. Open a Message Source form (select a Message Source and click Edit on the ribbon) and select the Properties tab.
Unzip Zipped Attachments
If this option is enabled then any incoming message containing zip file attachments will be automatically decompressed and the contents added as attachments and the zip attachment removed.
Append PDF, Word & Text Attachments To Body For Parsing
If this option is enabled then ThinkAutomation will automatically add text, Microsoft Word & PDF attachments to the plain text body of the message for parsing. You can then parse and extract data from the body text as normal. Rich text, Word and PDF attachments will first be converted to plain text before being added to the body.
In addition to PDF, Word and Richtext documents, ThinkAutomation will also append the text for any attachments with the following file extensions: txt, xml, ini, log, csv, vcf, vcard, md and any attachment with a content-type of: text/plain, text/vcard, text/calendar, application/json.
Append PDF Form Data To Body For Parsing
If this option is enabled then ThinkAutomation will extract form data from PDF attachments and add it to the plain text body of the message for parsing. Form data is added in the format: 'FieldName: value'. Each form value will be on a separate line.
The Append options are global for all messages received by the Message Source. You can also read PDF text and form data within an Automation using the Convert Document To Text action.
Drop Attachments
If this option is enabled then all attachments will be dropped from incoming messages. This option is useful if your Automation does not require access to attachments as it will improve performance and reduce the size of the Message Store database.
If the Append PDF, Word & Text Attachments To Body For Parsing option is enabled then the text content of the attachments will be added to the body text before the attachments themselves are dropped.
The Unzip Zipped Attachments, Append and Drop Attachments options do not affect the original incoming message. They only affect the message that is processed and stored by ThinkAutomation.
Send Notification On Message Source Errors
If this option is enabled then any errors that occur on the Message Source (for example an Office 365 login needs re-authenticating) will send a notification. The notification will appear in the Studio and an email will be sent to the default email address for the Solution.
Pause Message Source On Message Source Errors
If this option is enabled then any errors that occur on the Message Source will automatically pause the Message Source. This prevents the Message Source from trying to read more messages until the error is resolved.
Pause Message Source On Automation Errors
If this option is enabled then any errors that occur during Automation execution will automatically pause the Message Source. This prevents further messages from being processed until the error is resolved. A notification will appear in the ThinkAutomation Studio (and optionally an email will be sent) whenever a Message Source is auto-paused.
Reprocessing Existing Messages
For some Message Source types (Email, Database, File Pickup), ThinkAutomation checks if the message already exists in the Message Store before sending the message to an Automation for processing. This ensures the same incoming message is not processed twice.
If you want to reprocess existing messages you can either use the Reprocess option when viewing the Message Store, or you can delete the existing messages from the message store. For Email Message Source types, if you delete messages from the Message Store you will then need to click the Reset Sync Status button on the Message Store properties. This clears any sync status. ThinkAutomation will then start reading all messages again - and provided the messages do not already exist in the Message Store, they will be processed again as new messages.