Return target creature to its owner's hand. If you control an artifact, draw a card.
Whether you control an artifact is checked only after returning the target creature to its ownerâ€™s hand. If the target creature is the only artifact you control, you wonâ€™t draw a card.
If the target creature is an illegal target by the time Temporal Machinations tries to resolve, the spell doesnâ€™t resolve. You wonâ€™t draw a card.