Using 40+ Custom Tokens in Velocity Script: Risks and Considerations | Community
Skip to main content
Level 2
August 29, 2025
Solved

Using 40+ Custom Tokens in Velocity Script: Risks and Considerations

  • August 29, 2025
  • 1 reply
  • 1045 views

I understand that there's a limit of 40 custom field tokens that can be used directly in a Marketo email. If this limit is exceeded, Marketo throws an error indicating that the token limit has been crossed.

 

I'm curious whether using more than 40 custom tokens in a Velocity Script could cause any issues, such as dynamic content not displaying correctly or email delivery failures.

 

In my specific use case, I'm currently using 42 custom consent field tokens within if-elseif statements to conditionally show or hide the unsubscribe link in the email footer.

 

Has anyone had experience working with Velocity Scripts in Marketo and encountered issues when using more than 40 custom tokens? I'd appreciate any insights or best practices.

Best answer by SanfordWhiteman

The limit doesn't apply to $variables (which are not tokens) in Velocity.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
August 29, 2025

The limit doesn't apply to $variables (which are not tokens) in Velocity.

Level 2
September 9, 2025

Hi @sanfordwhiteman 

During my testing, emails using Velocity scripting with a large number of custom field variables (tokens) were not delivered. In my case, I used 42 custom field variables.
I added a 1-minute wait step before the Send Email step, and then the email was sent successfully. However, this only worked when the trigger was a data value change.
I also tested other triggers such as web form fill - custom activity, and program status change, but in those cases, the email was not sent.
As a result, there seem to be inconsistencies in email delivery when using many custom field variables.
I created another email with only a few custom field variables (around 5), and it was sent and delivered every single time.
Based on your experience, is this kind of inconsistency expected when using Velocity scripting with many tokens, or is it something unusual?

 

Thank you

Level 2
September 10, 2025

Hi @sanfordwhiteman 

To add further context to my testing regarding the email not being sent — it appears that Marketo is skipping the "Send Email" step and proceeding to the next step. Why would Marketo skip this step?

Thank you!