App Rules - Running an action

Hello @Ross_Grambo !

We are successfully running a workflow app already. However, we have some questions:

Our action contains some data (a selected A.I. workflow ID) required to run a specific workflow on the platform. And when we activate the trigger (task complete) for a task, we see action ID and some keys but no action data (workflow id):

This is what we receive when the Rule is executed with our action- no data about our stuff:

{'data': '{"workspace":<id>,"target_object":1200476725326538,"action_type":"run_workflow_v1","action":"1200485353243627","user":<userID>,"idempotency_key":"<key>","locale":"en","expires":1623934333166,"expires_at":"2021-06-17T12:52:13.166Z"}', 'token': '<token>'}

And this what we receive when we create a Rule with our action (see item description):

{'data': '{"action":"<workspace>","action_type":"run_workflow_v1","expires":1623934271142,"expires_at":"2021-06-17T12:51:11.142Z","locale":"en","project":1200403972781842,"rule_name":"Run a Workflow","user":<UserID>,"values":{"item-description":"38707cd2f3"},"workspace":<workspace>}', 'token': '<token>'}

Hence, the question is how can we get our data when running the rule on a task? Can API deliver us the same “values” with our item description?

Thanks a lot!

Hi @iliaZelenkin,

I’m cc’ing @AndrewWong here as I know Ross will be OOO for a bit.

I don’t believe you can get back any user-supplied data, but not 100% sure of that.

1 Like

Hey @iliaZelenkin, thanks for checking in. Phil is right – Asana has no knowledge of that user-supplied data. In your DB, you’ll probably want to map the action ID to an existing config to make sure you get the data you need. Hope this helps!

2 Likes

Hi @AndrewWong , thanks a lot for the prompt response.

Then another thing that we’ve noticed - when a user deletes the rule, the request has no any indication that this is a delete operation.

Here is how the flow looks like from API response point of view:

This is GET that we receive when a users add our action to the rule:

GET /asana/workflowapp/action/run_workflow_v1/metadata?action_type=run_workflow_v1&expires=1624008598218&expires_at=2021-06-18T09%3A29%3A58.218Z&locale=en&project=1200403972781842&user=1200240985587205&workspace=1200241034316392 HTTP/1.1

And this response we have when the rule is deleted:

GET /asana/workflowapp/action/run_workflow_v1/metadata?action_type=run_workflow_v1&expires=1624008702153&expires_at=2021-06-18T09%3A31%3A42.153Z&locale=en&project=1200403972781842&user=1200240985587205&workspace=1200241034316392&action=1200485353243630 HTTP/1.1

So how can we understand the difference between them? They look like identical.

1 Like

There is no event for adding or removing. The event your seeing in both of those scenarios is the “GET /metadata” endpoint, which is essentially “show the form”.

Currently there is no delete event. We put in a request to the API team to add that tracking. Should we add you as a developer to that request?

1 Like

You can add me. :slight_smile:

I haven’t gotten that far yet, but I’m sure I’ll run into the same thing when I do.

2 Likes

@Ross_Grambo, I think @Phil_Seeman 's proposal make more sense as you are in the same timezone.

And we are also fine to be added as a developer if needed.

1 Like