It would help us provide you with an answer specific to your situation if you share at least one of those automations and the target script. Questions Guidlines #9 & 11
One general option would be to attach variables to each trigger
triggers:
- trigger: state
entity_id: ?
to: ?
from: ?
variables:
type: A
direction: decrease
- trigger: state
entity_id: ?
to: ?
from: ?
variables:
type: B
direction: decrease
conditions: []
actions:
- action: script.example
data:
type: "{{ type }}"
direction: "{{ direction }}"