Updated on 2025-08-15 GMT+08:00

Adding an Invoke Template Diagram Element to a Flow

Function of the Assignment Diagram Element

Huawei Cloud Astro Zero enables quick creation of Word, Excel, Email, and SMS templates, enhancing document efficiency and standardization. You can configure this diagram element to generate a document based on the template configured in an application. For details, see Templates.

Using the Invoke Template Diagram Element

  1. Create a template scenario.

    A template scenario is a collection of service scenarios. Multiple templates can be created in a template scenario. The templates share the data structure. After a template scenario is created, it can be called in flows.
    1. Log in to the application designer by referring to Logging In to the Application Designer.
    2. In the navigation pane, choose Logic.
    3. Choose More > Templates, and click Add Template Scenario.
      Figure 1 Selecting Add Template Scenario
    4. Enter the label and name of the template and click Confirm.
      Figure 2 Creating a template scenario
      Table 1 Parameters for creating a template scenario

      Parameter

      Description

      Label

      Label name of the new template scenario, which is displayed on the page.

      Value: 1–64 characters.

      Name

      Name of the template scenario. The name is the unique identifier of the template scenario in the system and cannot be changed after being created. The naming requirements are as follows:

      • The value cannot exceed 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can create only one namespace. After being created, the namespace cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      Description

      Enter the description of the template scenario.

      Value: 1–255 characters.

    5. In the created template scenario, click the Configurations tab, configure the file storage location, and click the save button.
      Figure 3 Configuring the file storage information
      Table 2 Configuration parameters

      Parameter

      Description

      Generated File Name

      Set the name of the file generated based on the template. The file name can be Random or Custom. If this parameter is set to Custom, you can specify the name of the generated file based on service requirements.

      File Storage > Connector Type

      Connector type of the file storage. Currently, only OBS and MINIO are supported.

      File Storage > Connector Name

      Name of the OBS or MinIO connector created in the platform. You can choose Integrations > Connector > Connector Instance > Storage > OBS/MINIO to view the name.

      File Storage > Connector Bucket Name

      OBS or MinIO bucket name configured during connector creation.

      File Storage > File Storage Location

      You can specify the path for storing files in the OBS or MinIO bucket.

      Email Sending > Connector Name

      Name of the SMTP email service connector created in the platform. You can view the connector on the Integrations > Connector > Connector Instance > Message > Email by SMTP page. For details about how to create an SMTP email service connector, see Interconnecting with SMTP to Send Emails.

      SMS Sending > Connector Name

      Name of the SMN connector created in the platform. You can view the connector on the Integrations > Connector > Connector Instance > Message > SMN page. For details about how to create an SMN connector, see Connecting to SMN to Send SMS Messages.

  2. Add parameters to the template.

    The template parameters added here correspond to the content to be replaced in the document template.
    1. Click the Data tab and click the add button.
    2. Set parameters and click Save.
      Figure 4 Parameters for creating a template
      Table 3 Parameter descriptions

      Parameter

      Description

      Name

      Name of a parameter in the new template, which is displayed on the page.

      Value: 1–64 characters.

      Unique ID

      ID of a template parameter, which is unique in the system and cannot be modified after being created. The naming requirements are as follows:

      • The value cannot exceed 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can create only one namespace. After being created, the namespace cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      Type

      Select a parameter type from the drop-down list box. The options are text, number, currency, date, and date/time.

      This parameter is displayed only when this parameter is set to Basic.

      Object

      Select the required object. After the object is created, the parameter inherits the structure of the object, as shown in Figure 5.

      This parameter is displayed only when this parameter is set to Object.

      Description

      Enter the description of the template parameter in the text box as required.

      Value: 1–255 characters.

      Figure 5 Object parameters

  3. Add a template.

    You can add multiple templates to a template scenario. These templates can be preset in applications to send notifications or generate documents.

    1. Click the Templates tab and click Add.
    2. Set the template label and name, and click the confirm button.
      Figure 6 Setting template parameters
      Table 4 Parameters for creating a template

      Parameter

      Description

      Label

      Label of the new template, which is displayed on the page.

      Value: 1–64 characters.

      Name

      Name of the template. The name is the unique identifier of the template in the system and cannot be changed after being created. The naming requirements are as follows:

      • The value cannot exceed 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can create only one namespace. After being created, the namespace cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

      Description

      Enter the description of the template.

      Value: 1–255 characters.

      Template Type

      Type of the template to be created. The options are as follows. The default value is Word.

      • Word: You can upload a Word template. The recommended template size is less than 10 MB.
      • Excel: You can upload an Excel template. The uploaded Excel file cannot contain more than 10 sheets. Each sheet cannot contain more than 200 columns, 1,000 rows, and maximum 500 characters in each cell.
      • Email: You can compile email templates on the template editing page.
      • SMS: You can compile SMS templates on the template editing page.
    3. On the Templates tab page, click next to the created template. The document template page is displayed.
    4. Set related parameters based on the template type set in 3.b.
      • When Template Type is set to Word, click Click To Upload, select a Word document, and then view the upload result.
        The uploaded Word document must be in .docx format and should be less than 10 MB in size. If the document contains dynamic data (variables), use ${parameter} to define dynamic data. These parameters will be replaced with actual values when the document is generated.
        Figure 7 Uploading a Word document
        • When Template Type is set to Excel, click Click To Upload, select an Excel document, and then view the upload result.

          The uploaded Excel file must be in .xlsx format, with no more than 10 sheets. Each sheet must not exceed 200 columns, 1,000 rows, or 500 characters per cell. If the document contains dynamic data (variables), use ${parameter} to define dynamic data. These parameters will be replaced with actual values when the document is generated.

          Figure 8 Uploading an Excel file
        • When Template Type is set to Email. Click Edit, set the email content, and click Save.
          Figure 9 Setting the email content
          Table 5 Parameters for setting an email

          Parameter

          Description

          Recipient

          Recipient's email address (max. 4,096 characters). Use semicolons (;) to separate multiple addresses.

          CC

          Cc recipient address (max. 4,096 characters). Use semicolons (;) to separate multiple addresses.

          BCC

          Bcc recipient address (max. 4,096 characters). Use semicolons (;) to separate multiple addresses.

          Subject

          Email subject (max. 4,096 characters).

          Content

          Email content (max. 4,096 characters). Keep email content concise, clear, and logical to ensure accurate information delivery.

        • When Template Type is set to SMS, click Edit, set SMS content, and click Save.
          Figure 10 Setting the SMS message content
          Table 6 Parameters for setting the SMS message content

          Parameter

          Description

          Recipient Number

          Recipient's mobile number (max. 4,096 characters).

          Content

          Message content.

    5. If the preview meets your expectation, click Enable in the upper right corner of the page to enable the document template.
    6. Return to the document template scenario and click the enable button to enable the template scenario.

  4. Use the Invoke Template diagram element.

    1. On the flow design page, drag the Invoke Template diagram element from the basic area to the canvas.
    2. Select the Invoke Template diagram element, click , and set basic information.
      Table 7 Parameter description

      Parameter

      Description

      Label

      Label of the diagram element, which is displayed on the flow design page. The system automatically assigns a value in a specific Templatesequence number format, with the sequence number starting at 0 for each type of diagram element.

      Name

      Diagram element name, which must be unique in the current flow. The naming requirements are as follows:

      • Value: 1–80 characters.
      • Start with a letter and can contain letters, digits, and underscores (_). It cannot end with an underscore (_).

      Description

      Description of the diagram element.

      Value: 1–255 characters.

    3. Click and set the Invoke Template diagram element.
      Figure 11 Setting the Invoke Template diagram element
      Table 8 Parameter description

      Parameter

      Description

      Template Scenario

      Select the template scenario associated with the Invoke Template diagram element, that is, the template scenario created in 1.

      Document Template

      Select the document template created in 3.

      Connector Type

      Connector type of the generated document. The connector type can be saved to the default workspace (that is, the connector type specified when the template scenario is created in 1.e) or reset.

      Connector Name

      Connector name of the generated document. The connector name can be saved to the default workspace (that is, the connector name specified when the template scenario is created in 1.e) or reset.

      Connector Bucket Name

      Connector type of the generated document. The document can be saved to the default workspace (the connector bucket name specified when the template scenario is created in 1.e) or be reset.

      File Storage Location

      Path for storing the generated file. The file can be stored in the default workspace (that is, the file storage path specified when the template scenario is created in 1.e) or reset.

      Input Parameter

      Transfer data to the template and assign the input parameter variables to the corresponding template parameters at a time.

      Document Storage Address

      Assign the file storage location to a variable so that the file storage location can be referenced in service orchestration.