wtfutil/wtf · error

missing workspace id

Error message

missing workspace id

What it means

Validation guard in Fetch that fires only when mode is 'workspace' (or 'workspace_all' after the _all suffix is appended for allUsers) and the workspaceId setting is empty. Workspace mode cannot build an Asana query without a workspace identifier, so Fetch returns this error before calling the API. Fix by setting workspaceId in the widget config, or switching mode to a project-based mode which uses projectId instead.

Source

Thrown at modules/asana/widget.go:120

	} else {
		widget.settings.token = os.Getenv("WTF_ASANA_TOKEN")
	}

	if widget.settings.token == "" {
		return nil, fmt.Errorf("missing environment variable token or apikey config")
	}

	subMode := mode
	if allUsers && mode != "workspace" {
		subMode += "_all"
	}

	if projectId == "" && strings.HasPrefix(subMode, "project") {
		return nil, fmt.Errorf("missing project id")
	}

	if workspaceId == "" && subMode == "workspace" {
		return nil, fmt.Errorf("missing workspace id")
	}

	var tasks []*TaskItem
	var err error

	//lint:ignore QF1002 An untagged switch makes sense here.
	switch {
	case strings.HasPrefix(subMode, "project_sections"):
		tasks, err = fetchTasksFromProjectSections(widget.settings.token, projectId, sections, subMode)
	case strings.HasPrefix(subMode, "project"):
		tasks, err = fetchTasksFromProject(widget.settings.token, projectId, subMode)
	case subMode == "workspace":
		tasks, err = fetchTasksFromWorkspace(widget.settings.token, workspaceId, subMode)
	default:
		err = fmt.Errorf("no mode found")
	}

	if err != nil {

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. Set workspaceId in the Asana widget configuration
  2. Find the workspace ID via the Asana API or admin console and add it to the config
  3. Switch mode to project if a project-scoped view was intended instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/asana/widget.go:120 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/b361bea6ffed682b. Report an issue: GitHub.