Is there a way to send an email only once per environment?

We need to send a mail when our production deployment is finished.
Our production environment contains 5 servers.
If I add a step to send a mail, it will send it 5 times, once per server.

Is there any way to only send it once?

We are using version 2.6


Thanks for reaching out. Are you using a custom script step to send en email by any chance? If you are, then that’s the reason why you are getting an email per machine.

If you use the built-in email step (see attached screenshot) you should only get 1 email per deployment and not 1 per machine.



Hi Dalmiro,

Your absolutely right, we just assumed that was the way it would work. Because our slack notification notifies us 5 times.

On that note, is there a way to run a custom script only once per deployment?


You could add a custom script step and scope it to a specific role that only points to one machine. For example you have 5 machines in the environment “Dev” with the role “WebServer”. Have one of those also have the role “ScriptRunner” and then scope the custom script step to the “ScriptRunner” role.

What many users do in this case to avoid having to pick one of their servers as the scriptrunner, is turn the Octopus Server itself into a Tentacle and have that server run all the steps that only need to be executed once.



We thought about giving one of them a new role, like you suggested. But I think we will try installing a tentacle on the octopus server.

Thanks for the help :slight_smile: