Skip to main content

Sequentum Cloud Agent Templates

The Templates in Sequentum Cloud allows you to specify preformatted designs which can be used to develop and maintain multiple similar types of agents.
In Sequentum Cloud the Templates are assigned a specific identifier which can be distinguished by its icon.

Screenshot 2024-10-23 143937_enhanced-20241023-091726.jpg

Let’s dive into creating an Agent Template using the Sequentum Cloud platform.

Use Case

A template can be useful in following scenarios:

  1. When you have websites with similar structure and you need to use the same structure for extracting the data from similar multiple sites.

  2. Captcha solving templates can be used for solving the similar kind of captcha on different websites.

  3. If the delivery/ export destination is similar to any prior agent, one can use an export template for delivery.

Creating Template

To begin with an agent template, navigate to the Home dashboard, on the top right, there exists a drop down arrow next to the New Agent button. On the drop down we have the option of New Agent Template. Opting it would open the editor window and we are good to go, developing a template.

Kindly note, a template agent is similar to an agent but the difference lies in the structure in the ‘Text’ tab.

image-20241023-092304.png

We can set up Agent Templates to be used in other agents with similar structure. Developing an Agent Template is exactly the same as developing an agent. Add in commands common to the agents where the template would be used.

NOTE: In order for an agent template to be used/applied to other agents, one must save it in a common space and not in ‘Personal’ space.

Applying Template

I have an agent template Temp_generalStruct available in the Sequentum space. 

We’ll now develop an agent NewDeveloment_Website1 and use the aforementioned template in this new agent development.

We can apply an agent template from following two pages:

  1. Goto a space, click on agent check-box and select the Apply templates option to view a list of templates to apply on the selected agent.

  2. Open an agent’s detail page, navigate to the Apply templates option under the agent name. 

This will open a dropdown to select the template you want to apply, in this case Temp_generalStruct, and select Apply.

image-20241023-092453.png

Edit the Agent and one can see the settings of the agent template applied:

image-20241023-092338.png

NOTE: Keep in mind the following points while working with templates:

  • Commands added from Template are not editable as well as, in the Text tab they are preceded with a $ symbol to symbolize Template command.

  • Also, any changes made in the template are reflected in the agents using the template.

  • Template agent properties are prioritized over the agent properties.

Efficient Agent Design using templates

Design is an integral part of any product which determines the work and flow of each component when functioning together. Similarly an agent design should be preferred such that it is not much complex yet extracts all the required information. Keeping this in mind one can develop agents and make use of Templates to efficiently and effectively develop agents.

CODE
@Template
Agent:
    Parameters:
        InputFileName:
    Commands: Data Value
        Name: RunDate
        Input:
            Script:>
                using System;     

                public string GetData(RunContext context)
                {
                    return DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss");
                }

            Language: C#
    Export:
        Commands: JSON

The above Text snippet demonstrates a small sample agent Template containing, RunDate command which will determine the date of agent run and the file delivery as JSON file format. On applying this template to an agent, it will automatically add RunDate and JSON file format.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.