Good Practices Flow Designer on Sys Attachment

Akshay Marwah
Tera Contributor

Hi everyone,

 

My company is currently using Flow Designer to automate the process of moving attachments from ServiceNow to a different server. Specifically, we have flows set up to handle attachments related to various records. We aim to move files immediately after a user uploads or drags and drops them into the system.

 

Questions:

  1. Performance Impact: What are the potential performance implications of having flows that operate on sys_attachment records in real-time? Are there any known issues or considerations we should be aware of that might affect system performance or user experience, especially given that this action occurs immediately after file uploads?

  2.  

    Alternative Approaches: Would using attachment events be a more efficient or scalable solution compared to Flow Designer for handling attachments? If so, could you provide some examples or guidelines on how to implement this approach effectively?

  3. Best Practices: What are some recommended best practices for moving attachments out of ServiceNow immediately after upload to ensure minimal impact on system performance and maintainability?

Any advice, experiences, or recommendations would be greatly appreciated!

Thanks in advance for your help.

 

Best regards,
Akshay Marwah

1 REPLY 1

Community Alums
Not applicable

Hello @Akshay Marwah ,

 

I think, Using Flow Designer to move attachments immediately after upload can impact performance, especially if you’re dealing with large files or many uploads at once. This could slow down the system and affect user experience.

# Alternative Approach: Attachment Events
Attachment events might be a better option. They let you run scripts when attachments are added, which can be more efficient and scalable than flows. You can also make the process asynchronous, so it doesn’t slow down your instance.

# Example:
You could create a BR that triggers attachment uploads:

 

Condition: current.getTableName() === 'desired_table' and other condition

(function executeRule(current, previous) {

moveAttachmentToServer(current);

})(current, previous);

 

This way, the transfer happens in the background, reducing the immediate load.

 

# Best Practice
- Batch Processing: If real-time isn't critical, batch your transfers to reduce load.
- Limit File Sizes: Set restrictions to avoid performance hits with large files.
- Monitor Performance: Keep an eye on how this impacts your system and adjust as needed.

 

In short, attachment events with asynchronous handling are a solid approach for keeping things smooth and efficient.