Triptans are used during migraine attacks, for immediate relief of symptoms that have already begun. They are usually used if paracetamol or NSAIDs such as ibuprofen or diclofenac, don't help to relieve your migraine symptoms. Some people find using triptans together with paracetamol or NSAIDs effective. Read more about medicines for migraine.
Sumatriptan injection is also used to treat cluster headaches.
Timing
Triptans are most effective if taken at the first signs of a migraine attack while the pain is still mild, as this gives it time to absorb into your bloodstream and ease your symptoms. A triptan should be taken early during a migraine attack but not during the aura phase.