You will need xdotool.
Installation
sudo pacman -S xdotool
Usage
Going to the next workspace
xdotool set_desktop --relative 1
Going to the previous workspace
xdotool set_desktop --relative -1
NOTE: Negative numbers are said to be allowed, but some versions of xdotool do not allow negative numbers or at least give an error. Test negative numbers before you implement scripts with negative numbers.
Work around for going to the previous workspace
If you have n workspaces, then for going into the previous workspace
xdotool set_desktop --relative n-1
where n = number of workspaces.
Example:
n = 8 workspaces
xdotool set_desktop --relative 7