Use Amazon SWF to communicate messages between servers?

On server A I want to run a script A 
When that is finished I want to send a message to server B to run a script B 
If it completes successfully I want it to clear the job from the workflow queue

I’m having a really hard time working out how I can use Boto and SWF in combination to do this. I am not after some complete code but what I am after is if anyone can explain a little more about what is involved. 

How do I actually tell server B to check for the completion of script
A? 
How do I make sure server A wont pick up the completion of script
A and try and run script B (since server B should run this)? 
How do I actually notify SWF of script A completion? Is thee a flag, or a
message, or what?

I’m pretty confused about all of this. What design should I use?
You can use SNS,
  When script A is completed it should trigger SNS, and that will trigger a notification to Server B
Using Amazon SWF To communicate between servers