Action

Save Idea to Workflowy

Posted by agiletortoise, Last update 8 months ago

This action creates a new bullet in Workflowy using the first line of the draft as the text. The action integrates with their undocumented API, and is a demo based on the Shortcuts version shared by the Workflowy team.

To use the action, you will need to piece of information:

  • Workflowy API Key: Generate at Workflowy
  • URL of the Workflowy item where you want the new bullet added

(See their video demo linked above for details).

Edit this action and set your API key as the template value for the first “Define Template Tag” step, and the URL of the Workflowy item as the template for the second step. If you want to have multiple actions targeting different nodes in Workflowy, you can duplicate this action and change the value in second “workflowy-node-url” template step.

Steps

  • defineTemplateTag

    name
    workflowy-api-key
    template
    PUT-YOUR-API-KEY-HERE
  • defineTemplateTag

    name
    workflowy-node-url
    template
    URL-FOR-WORKFLOWY-NODE-HERE
  • script

    const apiKey = draft.processTemplate("[[workflowy-api-key]]")
    const node = draft.processTemplate("[[workflowy-node-url]]")
    const title = draft.processTemplate("[[title]]")
    
    const endpoint = "https://workflowy.com/api/bullets/create/"
    
    let http = new HTTP()
    let response = http.request({
    	"url": endpoint,
    	"method": "POST",
    	"data": {
    		"new_bullet_title": title,
    		"save_location_url": node
    	},
    	"headers": {
    		"Authorization": `Bearer ${apiKey}`
    	}
    })
    
    if (response.success) {
    	console.log("Workflowy bullet created")
    }
    else {
    	console.log(`Workflowy Error: ${response.statusCode}
    	
    ${response.responseText}`)
    	context.fail()
    }
    

Options

  • After Success Nothing
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.