Strategy for quick task search - stored file

I’d love feedback on a strategy for quick task search: I am thinking of storing all tasks data in a text file on a server rather than make individual API calls. Id like to know if anyone has done this or if its a sub-optimal strategy.

Here’s the context: Im developing a chatbot that provides a list of tasks during conversation. Unfortunately, searching Asana by task name can take about 20 seconds or more from the API to return a list of tasks that match the query. Id like something quicker. Id also like more control over the number of matches per search query.

So, I was going to set up a separate flask script that downloads all the task names and GIDs about every 3 hours onto a text file. That way, during a chatbot session, the bot has much quicker access to names and can respond at conversational speed. Id also like more control over the search quality than currently provided by Asana’s current API.

The tasks don’t really get updated more than once a day, so it works for my purposes.

Is this a sound strategy? Am I missing something or doing task search wrong?

Thanks for any feedback!

1 Like

Hello @gf11

Unfortuantely this is not within my remit, but let us see if anyone out there can help.

:mega: :mega: :mega: any of you gurus can help with such an idea?
@Bastien_Siebman @Julien_RENAUD @Phil_Seeman @Matt_Dickinson @Kenichi @Rebecca_McGrath @Emily_Roman @LEGGO

2 Likes

Are you using the Typehead API? It’s designed for your use case, and it shouldn’t be taking 20 seconds, I would hope.

3 Likes

Hi @gf11 - are these custom fields?

I go through a python extension that can call the API. forgive me if im not understanding correctly, but is the typehead API different than the commands in the ASANA python search package?

Thanks again for your help :slight_smile:

No theyre standard fields: gid, duedate, notes

I’m not familiar specifically with the Python client but just took a quick look at the Github repo to confirm - yes, typeahead is a whole different endpoint and functionality than search.

@Phil_Seeman the typehead is faster! But, it returns a bunch of completed tasks. I tried adding a param value for ‘completed’ : False but it didn’t seem to modify the results. Can typehead search results be filtered? Otherwise, I think i’ll need to use the file method. Thanks for your help!

My understanding is that you can submit a query for Typeahead that matches what you can submit with the Search API (so it would I think be something like completed=false) but I’ve never personally used the Typeahead functionality so I’m afraid I don’t know for sure.