Automate MFT supports the use of macros to dynamically insert values into file names and email alerts during task execution. Macros act as placeholders that are replaced with real-time data when a task runs, allowing for flexible and context-aware automation.

Use cases

Macros are commonly used in:
  • File renaming: Customize file names during transfer by embedding dynamic elements such as timestamps or original file names.
  • Email alerts: Include task-specific or file-specific details in alert messages for better traceability and context.
For example, you can rename a file during archiving to include the word Archive and the current date. If the original file is my_file.txt, you can configure the rename step as:
Archive-[yyyy]-[MM]-[dd]-[OrigName]
When the task completes, Automate MFT will rename the file to something like this:
Archive-2025-07-04-my_file.txt

Macros syntax

  • Macros must be enclosed in square brackets, for example, [OrigName].
  • Macros are case-sensitive.
  • Date/Time macros reflect the current system time on the Agent OS or UTC if using a cloud agent.
  • Macros do not reference file metadata such as last modified date.

Where to use macros

Automate MFT supports macros in two main contexts:
  • File-by-file processing: File-specific macros (such as [OrigName], [FileSize], [EmailSubject], and [EmailBody]) and date/time macros (such as [dd] and [yy]) are supported.
  • Post-run email steps: Task-specific macros (such as [TaskID] and [TaskFolder]) and date/time macros (such as [dd] and [yy]) are supported.

Supported macros

Table 1. File-specific macros - use in file renaming steps
Macro Description Example

[DestFileName]

Destination file name including extension. If the rename operation is enabled, the [DestFileName] must be updated with the new value.

report.pdf

[DestFolderPath]

Destination folder path without the file name.

If the file is located at /backup/monthly/report.pdf, the value is /backup/monthly/.

[FileSize]

Size of the file in bytes. 1048576

[ID]

Unique identifier of the file, in GUID format. 2b1e4f60-8c2a-4e5a-9b7d-3a2f6c8e9d12

[OnlyExt]

File extension. pdf

[OnlyName]

File name without extension. report

[OrigFullPath]

Full source path including file name. /backups/monthly/report.pdf

[OrigName]

Original file name with extension. report.pdf

[RelativePath]

Path relative to base folder. monthly/report.pdf

[TaskDescription]

Description of the task. Monthly backup of financial reports

[TaskExecID]

Unique ID of the task execution. 123456789

[TaskFolder]

Name of the organizational folder where the task is located

If the task is in All Tasks/First Level/Second Level/Third Level/, the value is Third Level

[TaskFolderFullPath]

Full folder path of the task.

If the task is in All Tasks/First Level/Second Level/Third Level/, the value is All Tasks/First Level/Second Level/Third Level

[TaskID]

Unique ID of the task. 987654321

[TaskName]

Name of the task. Monthly Backup

[TaskTags]

Comma-separated list of tags assigned to the task.

If the task has tags PCI and HIPAA, the value is PCI, HIPAA

[ActualStart]

Actual start time (using local timezone for the private agent or UTC for the cloud agent) in the format YYYY-MM-DD HH:MM:SS. 2025-01-23 09:00:00

[ErrorDescriptionTask]

Description of task error (only available as a post-task item). Internal server error

[NominalStart]

Scheduled start time (using local timezone for the private agent or UTC for the cloud agent) in the format YYYY-MM-DD HH:MM:SS. 2025-01-23 09:00:00

[TaskStatus]

Status of the task run. Success, Failure

[Params:{parameter name}]

This will use the value contained in the user defined parameter.

Whatever is currently contained in the user specified parameter.

Table 2. Task-specific macros - use in post-run email alerts
Macro Description Example
[ActualStart] Actual start time (using local timezone for the private agent or UTC for the cloud agent) in the format YYYY-MM-DD HH:MM:SS. 2025-01-23 09:00:00
[ErrorDescriptionTask] Description of task error (only available as a post-task item). Internal server error
[NominalStart] Scheduled start time (using local timezone for the private agent or UTC for the cloud agent) in the format YYYY-MM-DD HH:MM:SS. 2025-01-23 09:00:00
[TaskDescription] Description of the task. Monthly backup of financial reports
[TaskExecID] Unique ID of the task execution. 123456789
[TaskFolder] Name of the organizational folder where the task is located

If the task is in All Tasks/First Level/Second Level/Third Level/, the value is Third Level

[TaskFolderFullPath] Full folder path of the task.

If the task is in All Tasks/First Level/Second Level/Third Level/, the value is All Tasks/First Level/Second Level/Third Level

[TaskID] Unique ID of the task. 987654321
[TaskName] Name of the task. Monthly Backup
[TaskStatus] Status of the task run. Success, Failure
[TaskTags] Comma-separated list of tags assigned to the task.

If the task has tags PCI and HIPAA, the value is PCI, HIPAA

[Params:{parameter name}]

This will use the value contained in the user defined parameter.

Whatever is currently contained in the user specified parameter.

Table 3. Date/time macros - use in file renaming steps or post-run email alerts
Macro Description Example

[ddd]

Day of week; three-letter abbreviation.

Tue

[dddd]

Day of week; full.

Tuesday

[d]

Day of month; minimal representation.

7

[dd]

Day of month; two-digit representation.

07

[HH]

Hour; two-digit representation, 24-hour format.

07

[hh]

Hour; two-digit representation, 12-hour format.

07

[tt]

am/pm; two-digit representation.

pm

[M]

Month; minimal numeric representation.

7

[MM]

Month; two-digit numeric representation.

07

[MMM]

Month; short representation

Jan

[MMMM]

Month; full representation.

January

[ss]

Seconds; two-digit representation.

07

[mm]

Minutes; two-digit representation.

07

[yy]

Year; two-digit representation.

25

[yyyy]

Year; four-digit representation.

2025

When processing files downloaded from an IMAP endpoint, additional metadata from the source email message is available through macros.

IMAP source email macros
When processing files downloaded from an IMAP endpoint, additional metadata from the source email message is available through file-specific macros. These macros can be used when processing individual attachments, including within File Loops, conditional logic, file renaming, parameters, and notification actions.
Table 4. Email metadata macros
Macro Description Example

[EmailSubject]

Subject of the email message that contained the attachment.

Monthly Sales Report

[EmailTextContent]

The plain-text body of the email.

[EmailHtmlContent]

The HTML body of the email.

[EmailContent]

A convenience macro that evaluates to EmailTextContent; if that is null, falls back to EmailHtmlContent; if that is also null, resolves to an empty string ("").

Please find the attached sales report for June.