Sending i3 messages from shell scripts

It’s possible to send messages to i3 from shell scripts like

i3-msg workspace "n"