Asana Get Projects
Purpose
This node is designed to interact with the Asana API to retrieve project information from a specified workspace. It allows users to fetch a list of projects along with their relevant details such as project IDs, names, ownership, due dates, status (archived or public), and timestamps for creation and modification. This functionality is useful for teams managing multiple projects within Asana, allowing for integration with analytics and reporting features in the Vantage platform.
Settings
This node has a few key settings that dictate its behavior, as detailed below:
1. Workspace
- Input Type: String
- Description: Specifies the workspace from which to retrieve projects. If not provided, the component defaults to the first workspace found in the Asana account associated with the AI platform.
- Default Value: An empty string (
"")
Effects of Changing This Setting:
When the workspace is specified, only projects from that particular workspace will be fetched. If no workspace is specified, the system fetches projects from the first workspace available, which may yield unexpected results if the user intends to query a different workspace.
2. Max Results
- Input Type: Numeric
- Description: Determines the maximum number of project results to return from the API. This controls the pagination of results and limits the size of the response.
- Default Value: 100
Effects of Changing This Setting:
Modifying this value affects the number of project entries returned. A smaller number might be useful for quick checks, while a larger number can be applied for more comprehensive analytics and reporting. However, excessive values may lead to performance bottlenecks or slower response times due to the increased data load.
How It Works
This node operates asynchronously and utilizes the integration connection to establish a connection with the Asana API. The following steps outline its operation:
-
Retrieve Inputs: The function fetches the
workspaceandmaxResultsinputs from the provided parameters. If these inputs are absent, it defaults to predefined values: an empty string for workspace and 100 for max results. -
Establish Asana Integration: It uses the the integration connection to create an instance for connecting with the Asana API.
-
Fetch Workspace GID: If no workspace ID (GID) is specified, the logic calls the Asana API to get the first workspace's GID.
-
Fetch Projects: It requests project data from the Asana API using the specified or default workspace and the maximum results limit.
-
Transform Response: The returned project data is mapped to a more manageable structure, extracting pertinent information such as GID, name, owner, due date, archived status, and timestamps.
-
Error Handling: If any error occurs during the API calls, an error message is returned, ensuring the calling function is informed of internal issues that may arise.
-
Output: Finally, the defined project data along with the total count of projects is returned for further processing.
Expected Data
The function expects the following data structure in its inputs and config objects:
-
inputs:workspace: This should be a valid string representing the workspace GID, or it can be omitted to use the default behavior.maxResults: This should be a numerical value representing the desired limit of project results to fetch.
-
config:workspace: A fallback string for the workspace GID if not provided in inputs.maxResults: A fallback numeric value for maximum results if not specified in inputs.
Use Cases & Examples
Use Cases
-
Team Collaboration: A project management team needs to pull a report on all active projects under their workspace in Asana to monitor progress and resource allocation.
-
Data Analytics: A data scientist wants to analyze the performance of various projects over time by importing project data into the Vantage platform for further manipulation and visualization.
-
Project Health Monitoring: A project manager needs to maintain oversight of project deadlines and ownership across multiple projects to ensure timely completion.
Example Configuration
Use Case: Team Collaboration - Retrieving All Active Projects
To configure this node for retrieving all active projects from the "Product Development" workspace, the inputs might be structured as follows:
{
"inputs": {
"workspace": "1234567890", // Example GID for the "Product Development" workspace
"maxResults": 200 // Fetch up to 200 projects
},
"config": {
"workspace": "", // Defaults to first workspace if inputs.workspace is not provided
"maxResults": 100 // Default maxResults, will not apply here since input is provided
}
}In this setup, the team will obtain a comprehensive list of up to 200 projects in the specified workspace to streamline collaboration and project oversight. The larger result set assists in getting an extensive view of the ongoing initiatives.